From 562ce3296e5397734127c9fb15a53f0697e002de Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 21 Jan 2025 17:52:04 +0300 Subject: [PATCH] published_at-revert2 --- resolvers/editor.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index 1cb55322..f3b6a08f 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -114,26 +114,7 @@ async def create_shout(_, info, inp): logger.info(f"Creating shout with slug: {slug}") # Создаем объект Shout напрямую, без промежуточного словаря - new_shout = Shout( - title=inp.get("title", ""), - subtitle=inp.get("subtitle", ""), - lead=inp.get("lead", ""), - description=inp.get("description", ""), - body=inp.get("body", ""), - layout=inp.get("layout", "article"), - created_by=author_id, - slug=slug, - published_at=None, - community=1, - created_at=current_time, - stat={ # Добавляем начальную статистику - "views": 0, - "comments": 0, - "reactions": 0, - "shares": 0, - "bookmarks": 0 - } - ) + new_shout = Shout(**inp) # Check for duplicate slug logger.debug(f"Checking for existing slug: {slug}")