python3: specify explicit sorting algorithm for subscriptions.

This commit is contained in:
Tim Abbott 2016-01-23 20:23:02 -08:00
parent 05a827c520
commit f5de149976
1 changed files with 3 additions and 1 deletions

View File

@ -2398,7 +2398,9 @@ def gather_subscriptions_helper(user_profile):
for subscriber in sub['subscribers']:
user_ids.add(subscriber)
email_dict = get_emails_from_user_ids(list(user_ids))
return (sorted(subscribed), sorted(unsubscribed), email_dict)
return (sorted(subscribed, key=lambda x: x['name']),
sorted(unsubscribed, key=lambda x: x['name']),
email_dict)
def gather_subscriptions(user_profile):
subscribed, unsubscribed, email_dict = gather_subscriptions_helper(user_profile)