From 683f31e9aff90291a870f2a365ec9b706ec87fd7 Mon Sep 17 00:00:00 2001 From: Tony Rewin Date: Wed, 24 Nov 2021 16:39:20 +0300 Subject: [PATCH] minor --- resolvers/community.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resolvers/community.py b/resolvers/community.py index 891c1099..e60f5585 100644 --- a/resolvers/community.py +++ b/resolvers/community.py @@ -20,7 +20,7 @@ async def create_community(_, info, title, desc): @mutation.field("updateCommunity") @login_required -async def update_community(_, info, id, title, desc): +async def update_community(_, info, id, title, desc, pic): auth = info.context["request"].auth user_id = auth.user_id @@ -32,6 +32,7 @@ async def update_community(_, info, id, title, desc): return {"error": "access denied"} community.title = title community.desc = desc + community.pic = pic community.updatedAt = datetime.now() session.commit() @@ -46,9 +47,8 @@ async def delete_community(_, info, id): community = session.query(Community).filter(Community.id == id).first() if not community: return {"error": "invalid community id"} - if community.author != user_id: + if community.owner != user_id: return {"error": "access denied"} - community.deletedAt = datetime.now() session.commit()