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.

models: Pass realm as arg to select_related in get_system_bot.

Sahil Batra71c66cd75ceb
diff --git a/zerver/models.py b/zerver/models.py
index b15add50ec9..17952769914 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -3928,7 +3928,7 @@ def get_system_bot(email: str, realm_id: int) -> UserProfile:
the same realm as the one *to* which the message will be sent should be used - because
cross-realm messages will be eliminated as part of the migration.
"""
- return UserProfile.objects.select_related().get(email__iexact=email.strip())
+ return UserProfile.objects.select_related("realm").get(email__iexact=email.strip())
def get_user_by_id_in_realm_including_cross_realm(