handle-noauthor
This commit is contained in:
parent
dd2becaab2
commit
9c4d88c8fd
|
@ -108,7 +108,9 @@ async def get_shouts_drafts(_, info):
|
||||||
@login_required
|
@login_required
|
||||||
async def create_shout(_, info, inp):
|
async def create_shout(_, info, inp):
|
||||||
user_id = info.context.get("user_id")
|
user_id = info.context.get("user_id")
|
||||||
author_dict = info.context["author"]
|
author_dict = info.context.get("author")
|
||||||
|
if not author_dict:
|
||||||
|
return {"error": "author profile was not found"}
|
||||||
author_id = author_dict.get("id")
|
author_id = author_dict.get("id")
|
||||||
if user_id and author_id:
|
if user_id and author_id:
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user