minor: Move code for web_public_stream_ids.

This commit is contained in:
Steve Howell
2020-10-18 13:27:12 +00:00
committed by Tim Abbott
parent 0ca07ffd3c
commit c5769d31f2

View File

@@ -4930,7 +4930,6 @@ def gather_subscriptions_helper(user_profile: UserProfile,
stream_dicts = [stream for stream in all_streams if stream['id'] in stream_ids]
stream_hash = {}
web_public_stream_ids = [stream['id'] for stream in all_streams if stream['is_web_public']]
for stream in stream_dicts:
stream_hash[stream["id"]] = stream
@@ -5025,7 +5024,8 @@ def gather_subscriptions_helper(user_profile: UserProfile,
if user_profile.can_access_public_streams():
never_subscribed_stream_ids = all_streams_id_set - sub_unsub_stream_ids
else:
never_subscribed_stream_ids = set(web_public_stream_ids) - sub_unsub_stream_ids
web_public_stream_ids = {stream['id'] for stream in all_streams if stream['is_web_public']}
never_subscribed_stream_ids = web_public_stream_ids - sub_unsub_stream_ids
never_subscribed_streams = [ns_stream_dict for ns_stream_dict in all_streams
if ns_stream_dict['id'] in never_subscribed_stream_ids]