get_my_rates_comments-fix
All checks were successful
Deploy on push / deploy (push) Successful in 55s
All checks were successful
Deploy on push / deploy (push) Successful in 55s
This commit is contained in:
@@ -468,28 +468,28 @@ async def update_shout(_, info, shout_id: int, shout_input=None, publish=False):
|
||||
.filter(Shout.id == shout_id)
|
||||
.first()
|
||||
)
|
||||
|
||||
|
||||
# Создаем словарь с базовыми полями
|
||||
shout_dict = shout_with_relations.dict()
|
||||
|
||||
|
||||
# Явно добавляем связанные данные
|
||||
shout_dict["topics"] = [
|
||||
{
|
||||
"id": topic.id,
|
||||
"slug": topic.slug,
|
||||
"title": topic.title
|
||||
}
|
||||
for topic in shout_with_relations.topics
|
||||
] if shout_with_relations.topics else []
|
||||
|
||||
shout_dict["authors"] = [
|
||||
{
|
||||
"id": author.id,
|
||||
"name": author.name,
|
||||
"slug": author.slug
|
||||
}
|
||||
for author in shout_with_relations.authors
|
||||
] if shout_with_relations.authors else []
|
||||
shout_dict["topics"] = (
|
||||
[
|
||||
{"id": topic.id, "slug": topic.slug, "title": topic.title}
|
||||
for topic in shout_with_relations.topics
|
||||
]
|
||||
if shout_with_relations.topics
|
||||
else []
|
||||
)
|
||||
|
||||
shout_dict["authors"] = (
|
||||
[
|
||||
{"id": author.id, "name": author.name, "slug": author.slug}
|
||||
for author in shout_with_relations.authors
|
||||
]
|
||||
if shout_with_relations.authors
|
||||
else []
|
||||
)
|
||||
|
||||
logger.info(f"Final shout data with relations: {shout_dict}")
|
||||
return {"shout": shout_dict, "error": None}
|
||||
|
Reference in New Issue
Block a user