This commit is contained in:
2022-09-07 19:30:06 +03:00
parent e38d478ef2
commit bae0be1c7d
3 changed files with 10 additions and 9 deletions

View File

@@ -89,6 +89,6 @@ async def topics_random(_, info, amount=12):
topic_stat = await TopicStat.get_stat(topic.slug)
topic.stat = topic_stat
if topic_stat["shouts"] > 2:
normalized_topics.push(topic)
normalized_topics.append(topic)
sample_length = min(len(normalized_topics), amount)
return random.sample(normalized_topics, sample_length)