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_user_profile_by_email.
Sahil Batra584026b21f2e
diff --git a/zerver/models.py b/zerver/models.pyindex 5aa115ce3b3..b15add50ec9 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -3820,7 +3820,7 @@ def get_user_profile_by_email(email: str) -> UserProfile:multiple users with a given (delivery) email address existing on asingle server (in different realms)."""- return UserProfile.objects.select_related().get(delivery_email__iexact=email.strip())+ return UserProfile.objects.select_related("realm").get(delivery_email__iexact=email.strip())@cache_with_key(user_profile_by_api_key_cache_key, timeout=3600 * 24 * 7)