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)
This commit is contained in:
Tim Abbott 2013-08-22 11:48:21 -04:00
parent f5f95e5f43
commit a356a0a229
1 changed files with 4 additions and 2 deletions

View File

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