update-shout-fix

This commit is contained in:
Untone 2024-02-29 13:14:14 +03:00
parent d28024a69b
commit 9f30f251d6

View File

@ -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):