published-at-fix
Some checks failed
Deploy on push / deploy (push) Failing after 1m0s

This commit is contained in:
2025-08-23 15:06:53 +03:00
parent 00a866876c
commit e60b97a5c5
2 changed files with 217 additions and 1 deletions

View File

@@ -444,6 +444,7 @@ async def publish_draft(_: None, info: GraphQLResolveInfo, draft_id: int) -> dic
shout = session.query(Shout).where(Shout.id == draft.shout).first()
if shout:
# Обновляем существующую публикацию
now = int(time.time())
if hasattr(draft, "body"):
shout.body = draft.body
if hasattr(draft, "title"):
@@ -462,7 +463,9 @@ async def publish_draft(_: None, info: GraphQLResolveInfo, draft_id: int) -> dic
shout.lang = draft.lang
if hasattr(draft, "seo"):
shout.seo = draft.seo
shout.updated_at = int(time.time())
# 🩵 Критически важно: устанавливаем published_at для обеспечения видимости в списках
shout.published_at = now
shout.updated_at = now
shout.updated_by = author_id
else:
# Создаем новую публикацию