mirror of https://github.com/zulip/zulip.git
minor: Move context code down in the function.
This will make a subsequent diff a bit less noisy.
This commit is contained in:
parent
1d1e45e9ec
commit
428f0564a0
|
@ -233,12 +233,6 @@ def bulk_get_digest_context(users: List[UserProfile], cutoff: float) -> Dict[int
|
|||
stream_map = get_stream_map(user_ids)
|
||||
|
||||
for user in users:
|
||||
context = common_context(user)
|
||||
|
||||
# Start building email template data.
|
||||
unsubscribe_link = one_click_unsubscribe_link(user, "digest")
|
||||
context.update(unsubscribe_link=unsubscribe_link)
|
||||
|
||||
stream_ids = stream_map[user.id]
|
||||
|
||||
if user.long_term_idle:
|
||||
|
@ -247,6 +241,12 @@ def bulk_get_digest_context(users: List[UserProfile], cutoff: float) -> Dict[int
|
|||
recent_topics = get_recent_topics(sorted(list(stream_ids)), cutoff_date)
|
||||
hot_topics = get_hot_topics(recent_topics)
|
||||
|
||||
context = common_context(user)
|
||||
|
||||
# Start building email template data.
|
||||
unsubscribe_link = one_click_unsubscribe_link(user, "digest")
|
||||
context.update(unsubscribe_link=unsubscribe_link)
|
||||
|
||||
# Get context data for hot conversations.
|
||||
context["hot_conversations"] = [
|
||||
hot_topic.teaser_data(user)
|
||||
|
|
Loading…
Reference in New Issue