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.

export: Pass "user_profile" as arg to select_related call for Subscription.

Sahil Batra35559ae3249a
diff --git a/zerver/lib/export.py b/zerver/lib/export.py
index f688b28d2cf..8526801ce28 100644
--- a/zerver/lib/export.py
+++ b/zerver/lib/export.py
@@ -1120,10 +1120,10 @@ def custom_fetch_huddle_objects(response: TableData, context: Context) -> None:
# Mark all Huddles whose recipient ID contains a cross-realm user.
unsafe_huddle_recipient_ids = set()
- for sub in Subscription.objects.select_related().filter(
+ for sub in Subscription.objects.select_related("user_profile").filter(
recipient__in=realm_huddle_recipient_ids
):
- if sub.user_profile.realm != realm:
+ if sub.user_profile.realm_id != realm.id:
# In almost every case the other realm will be zulip.com
unsafe_huddle_recipient_ids.add(sub.recipient_id)