minor: Move context code down in the function.

This will make a subsequent diff a bit less noisy.
This commit is contained in:
Steve Howell 2020-11-13 10:20:38 +00:00 committed by Tim Abbott
parent 1d1e45e9ec
commit 428f0564a0
1 changed files with 6 additions and 6 deletions

View File

@ -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)