mirror of https://github.com/zulip/zulip.git
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:
parent
3e09a21929
commit
d0fe378075
|
@ -82,7 +82,7 @@ def get_active_realm_ids() -> ValuesQuerySet[RealmCount, int]:
|
|||
|
||||
|
||||
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()
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue