mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
stream: Pass group id to get recursive group members.
Previously, we needed to pass the group to the function, which sometimes meant having 1 extra query to fetch the user group when we just needed the group id for this function.
This commit is contained in:
committed by
Tim Abbott
parent
35f9305acb
commit
121af1c815
@@ -182,12 +182,14 @@ def get_default_values_for_stream_permission_group_settings(
|
||||
|
||||
def get_user_ids_with_metadata_access_via_permission_groups(stream: Stream) -> set[int]:
|
||||
stream_admin_user_ids = set(
|
||||
get_recursive_group_members(stream.can_administer_channel_group).values_list(
|
||||
get_recursive_group_members(stream.can_administer_channel_group_id).values_list(
|
||||
"id", flat=True
|
||||
)
|
||||
)
|
||||
stream_add_subscribers_group_user_ids = set(
|
||||
get_recursive_group_members(stream.can_add_subscribers_group).values_list("id", flat=True)
|
||||
get_recursive_group_members(stream.can_add_subscribers_group_id).values_list(
|
||||
"id", flat=True
|
||||
)
|
||||
)
|
||||
return stream_admin_user_ids | stream_add_subscribers_group_user_ids
|
||||
|
||||
|
||||
Reference in New Issue
Block a user