mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	actions: Fix incorrect audit logging in bulk_remove_subscriptions.
modified_user=sub_info.user and modified_stream=sub_info.stream, added
by commit 6d1f9de7d3 (#16553), were
always coming from the last entry in the loop above, not from the
enclosing list comprehension.
Found by the Pylint rule undefined-loop-variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							05b7d4ba13
						
					
				
				
					commit
					0ce015348e
				
			| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user