From 76a4c5fb537e1a6ae268ce094d39ac595f430c9f Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 21 Jan 2025 21:54:23 +0300 Subject: [PATCH] create-shout-fix5 --- resolvers/editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index e58a0ac5..6cff39e2 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -321,7 +321,9 @@ async def update_shout(_, info, shout_id: int, shout_input=None, publish=False): patch_main_topic(session, main_topic, shout_by_id) shout_input["updated_at"] = current_time - shout_input["published_at"] = current_time if publish else None + if publish: + logger.info(f"publishing shout#{shout_id} with input: {shout_input}") + shout_input["published_at"] = current_time Shout.update(shout_by_id, shout_input) session.add(shout_by_id) session.commit()