From 3476d6e6d14d6981b46026de66dcbef13c292aa9 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 6 Jun 2024 09:23:45 +0300 Subject: [PATCH] get_cached_topic_by_slug-fix --- resolvers/topic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resolvers/topic.py b/resolvers/topic.py index c2d4848f..1f0ef596 100644 --- a/resolvers/topic.py +++ b/resolvers/topic.py @@ -51,7 +51,7 @@ async def get_topics_by_author(_, _info, author_id=0, slug="", user=""): @query.field("get_topic") async def get_topic(_, _info, slug: str): - topic = await get_cached_topic_by_slug(slug) + topic = await get_cached_topic_by_slug(slug, get_with_stat) if topic: return topic @@ -124,7 +124,7 @@ def get_topics_random(_, _info, amount=12): @query.field("get_topic_followers") async def get_topic_followers(_, _info, slug: str): logger.debug(f"getting followers for @{slug}") - topic = await get_cached_topic_by_slug(slug) + topic = await get_cached_topic_by_slug(slug, get_with_stat) topic_id = topic.id if isinstance(topic, Topic) else topic.get("id") followers = await get_cached_topic_followers(topic_id) return followers @@ -133,7 +133,7 @@ async def get_topic_followers(_, _info, slug: str): @query.field("get_topic_authors") async def get_topic_authors(_, _info, slug: str): logger.debug(f"getting authors for @{slug}") - topic = await get_cached_topic_by_slug(slug) + topic = await get_cached_topic_by_slug(slug, get_with_stat) topic_id = topic.id if isinstance(topic, Topic) else topic.get("id") authors = await get_cached_topic_authors(topic_id) return authors