From 92246bc9d10dd1633d641c6c1ec636b32708d758 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 17 Feb 2024 09:35:11 +0300 Subject: [PATCH] create-update-shout-fix --- CHANGELOG.txt | 1 + resolvers/editor.py | 5 +++-- schema/input.graphql | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f13ef633..3dc46661 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ - enabling sentry - long query log report added - editor fixes +- authors links cannot be updated by update_shout anymore [0.3.0] - Shout.featured_at timestamp of the frontpage featuring event diff --git a/resolvers/editor.py b/resolvers/editor.py index 5eeb340a..a728a4b1 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -67,7 +67,7 @@ async def create_shout(_, info, inp): session.add(new_shout) session.commit() - # NOTE: shout made by one author + # NOTE: requesting new shout back shout = session.query(Shout).where(Shout.slug == slug).first() if shout: shout_dict = shout.dict() @@ -84,7 +84,7 @@ async def create_shout(_, info, inp): # notifier # await notify_shout(shout_dict, 'create') - return {'shout': shout_dict} + return { 'shout': shout.dict() } return {'error': 'cant create shout'} @@ -178,6 +178,7 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False): .filter(Shout.id == shout_id) .first() ) + if not shout: return {'error': 'shout not found'} if shout.created_by is not author.id and author.id not in shout.authors and 'editor' not in roles: diff --git a/schema/input.graphql b/schema/input.graphql index b46ea57b..e25a134a 100644 --- a/schema/input.graphql +++ b/schema/input.graphql @@ -6,7 +6,6 @@ input ShoutInput { description: String layout: String media: String - authors: [String] topics: [TopicInput] community: Int subtitle: String