From 6b011b241b375bf446cb2490148740e42561848b Mon Sep 17 00:00:00 2001 From: Clara Dantas Date: Thu, 30 Jul 2020 15:02:22 -0300 Subject: [PATCH] actions: Remove duplicated conditional. In the gather_subscriptions_helper functions, there was a repeated conditional inside one another. --- zerver/lib/actions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index c0e84c92f9..87d752d01b 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -5017,11 +5017,11 @@ def gather_subscriptions_helper(user_profile: UserProfile, stream_dict['is_announcement_only'] = \ stream['stream_post_policy'] == Stream.STREAM_POST_POLICY_ADMINS - if is_public or user_profile.is_realm_admin: - subscribers = subscriber_map[stream["id"]] - if subscribers is not None: - stream_dict['subscribers'] = subscribers + subscribers = subscriber_map[stream["id"]] + if subscribers is not None: + stream_dict['subscribers'] = subscribers never_subscribed.append(stream_dict) + return (sorted(subscribed, key=lambda x: x['name']), sorted(unsubscribed, key=lambda x: x['name']), sorted(never_subscribed, key=lambda x: x['name']))