draft-publish-fix
Some checks failed
Deploy on push / deploy (push) Failing after 2m36s

This commit is contained in:
2025-08-23 11:56:40 +03:00
parent d38c1485e4
commit ee53d5b491
4 changed files with 99 additions and 2 deletions

View File

@@ -502,7 +502,11 @@ async def publish_draft(_: None, info: GraphQLResolveInfo, draft_id: int) -> dic
logger.info(f"Successfully published shout #{shout.id} from draft #{draft_id}")
logger.debug(f"Shout data: {shout.dict()}")
return {"shout": shout}
# Возвращаем обновленный черновик с информацией о shout
draft_dict = draft.dict()
draft_dict["shout"] = {"id": shout.id, "slug": shout.slug, "published_at": shout.published_at}
return {"draft": draft_dict}
except Exception as e:
logger.error(f"Failed to publish draft {draft_id}: {e}", exc_info=True)