From 21888c6d003f7948d56c6d185a9fc849954cf485 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 31 Oct 2024 15:18:27 +0300 Subject: [PATCH] ismain-field --- resolvers/reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resolvers/reader.py b/resolvers/reader.py index b851a7e0..04994b26 100644 --- a/resolvers/reader.py +++ b/resolvers/reader.py @@ -267,7 +267,10 @@ def get_shouts_with_stats(q, limit=20, offset=0, author_id=None): for author in authors: author.caption = captions.get(author.id, "") shout.authors = authors - shout.topics = [Topic(**topic) for topic in topics_json] if topics_json else [] + topics = [Topic(**topic) for topic in topics_json] if topics_json else [] + for topic in topics: + topic.is_main = topic.slug == main_topic_slug + shout.topics = topics shout.stat = { "viewed": ViewedStorage.get_shout(shout.id), "rating": rating_stat or 0,