From 59b68aaa9873289f63ac900ce7179b228ada1a11 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 16 Jun 2020 10:39:43 -0700 Subject: [PATCH] events: Remove incorrect line from new-stream handler. This line was effectively hardcoding a specific stream_post_policy, overriding the value already present in the event, to no purpose. (I believe it got here via cargo-culting induced by #13787.) --- zerver/lib/events.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zerver/lib/events.py b/zerver/lib/events.py index 472907cc34..df2550a57d 100644 --- a/zerver/lib/events.py +++ b/zerver/lib/events.py @@ -521,8 +521,13 @@ def apply_event(state: Dict[str, Any], stream_data = copy.deepcopy(stream) if include_subscribers: stream_data['subscribers'] = [] + + # We know the stream has no traffic, and this + # field is not present in the event. + # + # TODO: Probably this should just be added to the event. stream_data['stream_weekly_traffic'] = None - stream_data['stream_post_policy'] = Stream.STREAM_POST_POLICY_EVERYONE + # Add stream to never_subscribed (if not invite_only) state['never_subscribed'].append(stream_data) state['streams'].append(stream)