From 9f30f251d6deb789e681b1ed23f3bb4007d6239a Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 29 Feb 2024 13:14:14 +0300 Subject: [PATCH] update-shout-fix --- resolvers/editor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index 38199b6c..97bcb6bb 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -195,13 +195,13 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False): ) c = 1 while same_slug_shout is not None: - same_slug_shout = ( - session.query(Shout) - .filter(Shout.slug == shout_input.get('slug')) - .first() - ) c += 1 slug += f'-{c}' + same_slug_shout = ( + session.query(Shout) + .filter(Shout.slug == slug) # Use the updated slug value here + .first() + ) shout_input['slug'] = slug if isinstance(author, Author) and isinstance(shout_id, int):