From 61c7f5a0dc125c3fe259559264271b815ee685d7 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 30 Apr 2024 14:10:01 +0300 Subject: [PATCH] drafts-debug --- resolvers/editor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index c7a11335..4ee98362 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -50,8 +50,12 @@ async def get_my_shout(_, info, shout_id: int): @query.field("get_shouts_drafts") @login_required async def get_shouts_drafts(_, info): - info.context.get("user_id") - author_dict = info.context["author"] + # user_id = info.context.get("user_id") + author_dict = info.context.get("author") + if not author_dict: + logger.error("trying to get drafts failed") + logger.debug(info) + return [] author_id = author_dict.get("id") shouts = [] with local_session() as session: