Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

digest: Remove comments from get_hot_topics.

Vishnu KS3f4f16f4f1d8
diff --git a/zerver/lib/digest.py b/zerver/lib/digest.py
index d46c3a8cf73..b2d98080921 100644
--- a/zerver/lib/digest.py
+++ b/zerver/lib/digest.py
@@ -187,11 +187,8 @@ def get_hot_topics(
if topic.stream_id() in stream_ids
]
- # Start with the two most diverse topics.
hot_topics = heapq.nlargest(2, topics, key=DigestTopic.diversity)
- # Pad out our list up to MAX_HOT_TOPICS_TO_BE_INCLUDED_IN_DIGEST items,
- # using the topics' length (aka message count) as the secondary filter.
for topic in heapq.nlargest(MAX_HOT_TOPICS_TO_BE_INCLUDED_IN_DIGEST, topics, key=DigestTopic.length):
if topic not in hot_topics:
hot_topics.append(topic)