filter fix
This commit is contained in:
parent
ef6adbb4ea
commit
114b2d8b0f
|
@ -89,8 +89,8 @@ async def topics_random(_, info):
|
||||||
topics = await TopicStorage.get_topics_all(1, 700)
|
topics = await TopicStorage.get_topics_all(1, 700)
|
||||||
normalized_topics = []
|
normalized_topics = []
|
||||||
for topic in topics:
|
for topic in topics:
|
||||||
shouts_amount = await TopicStat.get_stat(topic.slug)
|
topic_stat = await TopicStat.get_stat(topic.slug)
|
||||||
topic.stat = shouts_amount
|
topic.stat = topic_stat
|
||||||
if shouts_amount > 2:
|
if topic_stat["shouts"] > 2:
|
||||||
normalized_topics.push(topic)
|
normalized_topics.push(topic)
|
||||||
return random.choices(topics)[0:12]
|
return random.choices(topics)[0:12]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user