Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

actions: Fix incorrect audit logging in bulk_remove_subscriptions.

Anders Kaseorg0ce015348e50
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 7682d106d06..dd36143f10f 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -3921,7 +3921,7 @@ def bulk_remove_subscriptions(
event_last_message_id = get_last_message_id()
all_subscription_logs = [
RealmAuditLog(
- realm=sub.user.realm,
+ realm=sub_info.user.realm,
acting_user=acting_user,
modified_user=sub_info.user,
modified_stream=sub_info.stream,
@@ -3929,7 +3929,7 @@ def bulk_remove_subscriptions(
event_type=RealmAuditLog.SUBSCRIPTION_DEACTIVATED,
event_time=event_time,
)
- for sub in subs_to_deactivate
+ for sub_info in subs_to_deactivate
]
# Now since we have all log objects generated we can do a bulk insert