mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
realms: Do not prefetch settings in get_realm.
There is no need to prefetch group settings using select_related in get_realm as we only need to save queries when computing the setting values in fetch_initial_state_data and we already refetch the realm using get_realm_with_settings for that.
This commit is contained in:
@@ -1064,10 +1064,7 @@ post_delete.connect(realm_pre_and_post_delete_handler, sender=Realm)
|
||||
|
||||
|
||||
def get_realm(string_id: str) -> Realm:
|
||||
return Realm.objects.select_related(
|
||||
"can_create_public_channel_group",
|
||||
"can_create_public_channel_group__named_user_group",
|
||||
).get(string_id=string_id)
|
||||
return Realm.objects.get(string_id=string_id)
|
||||
|
||||
|
||||
def get_realm_by_id(realm_id: int) -> Realm:
|
||||
|
||||
Reference in New Issue
Block a user