mirror of https://github.com/zulip/zulip.git
performance: Use select_related when computing autocomplete lists.
(imported from commit fde08787998179451e6684a101c80aaafca917f6)
This commit is contained in:
parent
a92be363d7
commit
7ebc720347
|
@ -158,10 +158,10 @@ def home(request):
|
|||
people = [{'email' : profile.user.email,
|
||||
'full_name' : profile.full_name}
|
||||
for profile in
|
||||
UserProfile.objects.filter(realm=user_profile.realm) if
|
||||
UserProfile.objects.select_related().filter(realm=user_profile.realm) if
|
||||
profile != user_profile]
|
||||
|
||||
subscriptions = Subscription.objects.filter(userprofile_id=user_profile, active=True)
|
||||
subscriptions = Subscription.objects.select_related().filter(userprofile_id=user_profile, active=True)
|
||||
streams = [get_display_recipient(sub.recipient) for sub in subscriptions
|
||||
if sub.recipient.type == Recipient.STREAM]
|
||||
|
||||
|
|
Loading…
Reference in New Issue