Gets rid of redundant create_comment function

This commit is contained in:
Oleg Silkin 2019-12-30 17:27:38 -05:00
parent 7dee7cc853
commit c55012176e

View file

@ -1,19 +1,18 @@
import asyncio
import logging import logging
import time import time
import asyncio
from aiohttp import web from aiohttp import web
from aiojobs.aiohttp import atomic from aiojobs.aiohttp import atomic
from src.server.misc import clean_input_params, report_error
from src.database.queries import get_claim_comments
from src.database.queries import get_comments_by_id, get_comment_ids
from src.database.queries import get_channel_id_from_comment_id from src.database.queries import get_channel_id_from_comment_id
from src.database.queries import get_claim_comments
from src.database.queries import get_claim_hidden_comments from src.database.queries import get_claim_hidden_comments
from src.server.misc import make_error from src.database.queries import get_comments_by_id, get_comment_ids
from src.database.writes import abandon_comment_if_authorized, create_comment from src.database.writes import abandon_comment_if_authorized, create_comment
from src.database.writes import hide_comments_where_authorized from src.database.writes import hide_comments_where_authorized
from src.server.misc import clean_input_params
from src.server.errors import make_error, report_error
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -43,10 +42,6 @@ def handle_get_claim_hidden_comments(app, kwargs):
return get_claim_hidden_comments(app['reader'], **kwargs) return get_claim_hidden_comments(app['reader'], **kwargs)
async def handle_create_comment(app, params):
return await create_comment(app, params)
async def handle_abandon_comment(app, params): async def handle_abandon_comment(app, params):
return {'abandoned': await abandon_comment_if_authorized(app, **params)} return {'abandoned': await abandon_comment_if_authorized(app, **params)}
@ -62,7 +57,7 @@ METHODS = {
'get_comment_ids': handle_get_comment_ids, 'get_comment_ids': handle_get_comment_ids,
'get_comments_by_id': handle_get_comments_by_id, 'get_comments_by_id': handle_get_comments_by_id,
'get_channel_from_comment_id': handle_get_channel_from_comment_id, 'get_channel_from_comment_id': handle_get_channel_from_comment_id,
'create_comment': handle_create_comment, 'create_comment': create_comment,
'delete_comment': handle_abandon_comment, 'delete_comment': handle_abandon_comment,
'abandon_comment': handle_abandon_comment, 'abandon_comment': handle_abandon_comment,
'hide_comments': handle_hide_comments 'hide_comments': handle_hide_comments