mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
soft_deactivation: Clarify loop logic around stream_messages.
Break will do the same thing as continue here, as each iteration will have the same result, and it's also worth explaining why this isn't one layer up in the loop setup.
This commit is contained in:
@@ -32,7 +32,10 @@ def filter_by_subscription_history(user_profile: UserProfile,
|
||||
|
||||
for log_entry in stream_subscription_logs:
|
||||
if len(stream_messages) == 0:
|
||||
continue
|
||||
# Because stream_messages gets mutated below, this
|
||||
# check belongs in this inner loop, not the outer loop.
|
||||
break
|
||||
|
||||
if log_entry.event_type == RealmAuditLog.SUBSCRIPTION_DEACTIVATED:
|
||||
for stream_message in stream_messages:
|
||||
if stream_message['id'] <= log_entry.event_last_message_id:
|
||||
|
||||
Reference in New Issue
Block a user