diff --git a/bots/sync-public-streams b/bots/sync-public-streams index f6d71702a8..4d03314e18 100755 --- a/bots/sync-public-streams +++ b/bots/sync-public-streams @@ -27,9 +27,10 @@ def fetch_public_streams(): return None for stream in streams: + stream_name = stream["name"] # Zephyr class names are canonicalized by first applying NFKC # normalization and then lower-casing server-side - canonical_cls = unicodedata.normalize("NFKC", stream).lower().encode("utf-8") + canonical_cls = unicodedata.normalize("NFKC", stream_name).lower().encode("utf-8") if canonical_cls in ['security', 'login', 'network', 'ops', 'user_locate', 'mit', 'hm_ctl', 'hm_stat', 'zephyr_admin', 'zephyr_ctl']: diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index b963287a16..795186d072 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -542,7 +542,9 @@ exports.setup_page = function () { /* arguments are [ "success", statusText, jqXHR ] */ if (stream_data.length > 2 && stream_data[2]) { var stream_response = JSON.parse(stream_data[2].responseText); - all_streams = stream_response.streams; + $.each(stream_response.streams, function(idx, stream) { + all_streams.push(stream.name); + }); } if (subscription_data.length > 2 && subscription_data[2]) { var subs_response = JSON.parse(subscription_data[2].responseText); diff --git a/zephyr/views.py b/zephyr/views.py index cb5618ecd2..014f6cf421 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -1181,7 +1181,7 @@ def get_public_streams_backend(request, user_profile): subs_filter = Subscription.objects.filter(active=True).values('recipient_id') stream_ids = Recipient.objects.filter( type=Recipient.STREAM, id__in=subs_filter).values('type_id') - streams = sorted(stream.name for stream in + streams = sorted({"name": stream.name} for stream in Stream.objects.filter(id__in = stream_ids, realm=user_profile.realm, invite_only=False))