From f378925a164ca9555f81dd2f66d1cd306256be70 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 5 Mar 2024 18:13:39 +0300 Subject: [PATCH] update-shout-fix-8 --- resolvers/editor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index 74f8c55b..35f8614c 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -174,7 +174,7 @@ def patch_topics(session, shout, topics_input): @mutation.field('update_shout') @login_required -async def update_shout(_, info, shout_id, shout_input=None, publish=False): +async def update_shout(_, info, shout_id: int, shout_input=None, publish=False): user_id = info.context.get('user_id') roles = info.context.get('roles', []) shout_input = shout_input or {} @@ -185,11 +185,9 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False): return {"error": "unauthorized"} try: with local_session() as session: - logger.debug(user_id) author = session.query(Author).filter(Author.user == user_id).first() - logger.debug(author) if author: - logger.info(f'author detected {author.dict()}') + logger.info(f'author for shout#{shout_id} detected {author.dict()}') shout_by_id = session.query(Shout).filter(Shout.id == shout_id).first() if not shout_by_id: return {'error': 'shout not found'}