mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
python3: Fix usage of .keys()/.values() to handle iterators.
This fixes the places where we use the result of .keys(), .items(), and .values() that wouldn't work with an iterator to wrap them with list().
This commit is contained in:
@@ -53,10 +53,10 @@ def gather_hot_conversations(user_profile, stream_messages):
|
||||
user_message.message.sender.full_name)
|
||||
conversation_length[key] += 1
|
||||
|
||||
diversity_list = conversation_diversity.items()
|
||||
diversity_list = list(conversation_diversity.items())
|
||||
diversity_list.sort(key=lambda entry: len(entry[1]), reverse=True)
|
||||
|
||||
length_list = conversation_length.items()
|
||||
length_list = list(conversation_length.items())
|
||||
length_list.sort(key=lambda entry: entry[1], reverse=True)
|
||||
|
||||
# Get up to the 4 best conversations from the diversity list
|
||||
|
||||
Reference in New Issue
Block a user