mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
subs: Allow filtering by is_user_active in get_active_subscriptions.
get_active_subscriptions_for_stream_id should allow specifying whether subscriptions of deactivated users should be included in the result. Active subs of deactivated users are a subtlety that's easy to miss when writing relevant code, so we make include_deactivated_users a mandatory kwarg - this will force callers to definitely give thought to whether such subs should be included or not. This commit is just a refactoring, we keep original behavior everywhere - there are places where subs of deactivates users should probably be excluded but aren't - we don't fix that here, it'll be addressed in follow-up commits.
This commit is contained in:
committed by
Tim Abbott
parent
efc63ae7ce
commit
50bfbb588e
@@ -28,4 +28,6 @@ class StreamTopicTarget:
|
||||
return {row["user_profile_id"] for row in query}
|
||||
|
||||
def get_active_subscriptions(self) -> QuerySet:
|
||||
return get_active_subscriptions_for_stream_id(self.stream_id)
|
||||
return get_active_subscriptions_for_stream_id(
|
||||
self.stream_id, include_deactivated_users=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user