mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08: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:
parent
99414e2d96
commit
a1d2b73790
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user