mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
cache_helpers: Pass "realm" and "bot_owner" args to select_related.
This commit updates code to pass "realm" and "bot_owner" args to select_related call in get_users. We pass "realm" and "bot_owner" args to get_users because the caches which this function is used to populate are used for get_user and get_user_profile_by_api_key functions and they also select both these fields when querying for UserProfile objects.
This commit is contained in:
@@ -82,7 +82,7 @@ def get_active_realm_ids() -> ValuesQuerySet[RealmCount, int]:
|
|||||||
|
|
||||||
|
|
||||||
def get_users() -> QuerySet[UserProfile]:
|
def get_users() -> QuerySet[UserProfile]:
|
||||||
return UserProfile.objects.select_related().filter(
|
return UserProfile.objects.select_related("realm", "bot_owner").filter(
|
||||||
long_term_idle=False, realm__in=get_active_realm_ids()
|
long_term_idle=False, realm__in=get_active_realm_ids()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user