Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

cache_helpers: Pass "realm" and "bot_owner" args to select_related.

Sahil Batrad0fe37807553
diff --git a/zerver/lib/cache_helpers.py b/zerver/lib/cache_helpers.py
index 61d9efba9d9..5c18a7007eb 100644
--- a/zerver/lib/cache_helpers.py
+++ b/zerver/lib/cache_helpers.py
@@ -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()
)