mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
notify_subscriptions_*: Fix use of leaked stream variable.
While I believe this actually produced correct output since users are always subscribed to streams within their realm, this code was definitely wrong. Discovered using the mypy type-checking tool.
This commit is contained in:
@@ -1135,7 +1135,7 @@ def notify_subscriptions_added(user_profile, sub_pairs, stream_emails, no_log=Fa
|
||||
log_event({'type': 'subscription_added',
|
||||
'user': user_profile.email,
|
||||
'names': [stream.name for sub, stream in sub_pairs],
|
||||
'domain': stream.realm.domain})
|
||||
'domain': user_profile.realm.domain})
|
||||
|
||||
# Send a notification to the user who subscribed.
|
||||
payload = [dict(name=stream.name,
|
||||
@@ -1305,7 +1305,7 @@ def notify_subscriptions_removed(user_profile, streams, no_log=False):
|
||||
log_event({'type': 'subscription_removed',
|
||||
'user': user_profile.email,
|
||||
'names': [stream.name for stream in streams],
|
||||
'domain': stream.realm.domain})
|
||||
'domain': user_profile.realm.domain})
|
||||
|
||||
payload = [dict(name=stream.name, stream_id=stream.id) for stream in streams]
|
||||
event = dict(type="subscription", op="remove",
|
||||
|
||||
Reference in New Issue
Block a user