groups: Do not prefetch can_access_all_users_group setting.

This commit updates code to not prefetch can_access_all_users_group
and can_access_all_users_group__named_user_group fields using
select_related. We can just use get_realm_system_groups_name_dict
function to check if setting is set to "Everyone" group when
needed and can avoid unnecessarily fetching groups for every user
query.
This commit is contained in:
Sahil Batra
2025-04-10 20:53:50 +05:30
committed by Tim Abbott
parent 7e77100433
commit c5b005833c
12 changed files with 57 additions and 67 deletions

View File

@@ -1028,8 +1028,8 @@ class LoginTest(ZulipTestCase):
# to sending messages, such as getting the welcome bot, looking up
# the alert words for a realm, etc.
with (
self.assert_database_query_count(94),
self.assert_memcached_count(15),
self.assert_database_query_count(93),
self.assert_memcached_count(18),
self.captureOnCommitCallbacks(execute=True),
):
self.register(self.nonreg_email("test"), "test")