From f5de149976c452e7b1865d5ad3a54d30ca7dcf77 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 23 Jan 2016 20:23:02 -0800 Subject: [PATCH] python3: specify explicit sorting algorithm for subscriptions. --- zerver/lib/actions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 8735264760..d7d16d65af 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -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)