mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
groups: Use realm_for_sharding for limiting NamedUserGroup queries.
For get and filter queries of NamedUserGroup, realm_for_sharding field is used instead of realm field, as directly using realm_for_sharding field on NamedUserGroup makes the query faster than using realm present on the base UserGroup table.
This commit is contained in:
@@ -110,10 +110,10 @@ def update_users_in_full_members_system_group(
|
||||
realm: Realm, affected_user_ids: Sequence[int] = [], *, acting_user: UserProfile | None
|
||||
) -> None:
|
||||
full_members_system_group = NamedUserGroup.objects.get(
|
||||
realm=realm, name=SystemGroups.FULL_MEMBERS, is_system_group=True
|
||||
realm_for_sharding=realm, name=SystemGroups.FULL_MEMBERS, is_system_group=True
|
||||
)
|
||||
members_system_group = NamedUserGroup.objects.get(
|
||||
realm=realm, name=SystemGroups.MEMBERS, is_system_group=True
|
||||
realm_for_sharding=realm, name=SystemGroups.MEMBERS, is_system_group=True
|
||||
)
|
||||
|
||||
full_member_group_users: list[MemberGroupUserDict] = list()
|
||||
|
||||
Reference in New Issue
Block a user