create-shout-fix2
This commit is contained in:
parent
eff8278cc3
commit
ae584abb5b
|
@ -111,12 +111,15 @@ async def create_shout(_, info, inp):
|
||||||
current_time = int(time.time())
|
current_time = int(time.time())
|
||||||
slug = inp.get("slug") or f"draft-{current_time}"
|
slug = inp.get("slug") or f"draft-{current_time}"
|
||||||
|
|
||||||
logger.info(f"Creating shout with slug: {slug}")
|
logger.info(f"Creating shout with input: {inp}")
|
||||||
|
|
||||||
# Правильно:
|
|
||||||
new_shout = Shout(
|
new_shout = Shout(
|
||||||
**inp, # распаковываем входные данные
|
slug=slug,
|
||||||
slug=slug, # явно указываем именованные аргументы
|
published_at=None,
|
||||||
|
body=inp.get("body", ""),
|
||||||
|
layout=inp.get("layout", "article"),
|
||||||
|
title=inp.get("title", ""),
|
||||||
|
topics=inp.get("topics", []),
|
||||||
created_by=author_id,
|
created_by=author_id,
|
||||||
created_at=current_time,
|
created_at=current_time,
|
||||||
community=1
|
community=1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user