From a356a0a229d004e788bb67f102d07b506316e02c Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 22 Aug 2013 11:48:21 -0400 Subject: [PATCH] Enable get_streams to list subs for mit.edu realm. This makes the mit.edu setup share code with the CUSTOMER5 special case. (imported from commit 5d1d824d5ab4b50a6b11a94526efc57a0bdf8cb0) --- zerver/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zerver/views.py b/zerver/views.py index 2a88bcb7d3..78497adef2 100644 --- a/zerver/views.py +++ b/zerver/views.py @@ -1300,10 +1300,12 @@ def get_streams_backend(request, user_profile, include_public=REQ(converter=json_to_bool, default=True), include_subscribed=REQ(converter=json_to_bool, default=True), include_all_active=REQ(converter=json_to_bool, default=False)): - if include_all_active or (include_public and user_profile.realm.domain == "mit.edu"): - if not is_super_user_api(request): + if include_all_active and not is_super_user_api(request): return json_error("User not authorized for this query") + # Listing public streams are disabled for the mit.edu realm. + include_public = include_public and not user_profile.realm.domain == "mit.edu" + # Only get streams someone is currently subscribed to subs_filter = Subscription.objects.filter(active=True).values('recipient_id') stream_ids = Recipient.objects.filter(