mirror of https://github.com/zulip/zulip.git
gather_subscriptions: Avoid extra queries fetching realm objects.
(imported from commit 591083cfaff454b8ce48aacb5da7913b8fe0a38f)
This commit is contained in:
parent
5e420dc5c3
commit
e9ee05b2b2
|
@ -1452,7 +1452,7 @@ def gather_subscriptions(user_profile):
|
||||||
stream_ids = [sub.recipient.type_id for sub in subs]
|
stream_ids = [sub.recipient.type_id for sub in subs]
|
||||||
|
|
||||||
stream_hash = {}
|
stream_hash = {}
|
||||||
for stream in Stream.objects.filter(id__in=stream_ids):
|
for stream in Stream.objects.select_related("realm").filter(id__in=stream_ids):
|
||||||
stream_hash[stream.id] = stream
|
stream_hash[stream.id] = stream
|
||||||
|
|
||||||
subscribed = []
|
subscribed = []
|
||||||
|
|
Loading…
Reference in New Issue