Commit dfdc4c75 authored by Michal Čihař's avatar Michal Čihař

Prefetch more values we use

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent e0810def
...@@ -42,7 +42,11 @@ class Command(BaseCommand): ...@@ -42,7 +42,11 @@ class Command(BaseCommand):
'suggested', 'suggested',
) + Profile.SUBSCRIPTION_FIELDS ) + Profile.SUBSCRIPTION_FIELDS
profiles = Profile.objects.select_related('user', 'subscriptions') profiles = Profile.objects.select_related(
'user'
).prefetch_related(
'subscriptions', 'languages', 'secondary_languages'
)
for profile in profiles.iterator(): for profile in profiles.iterator():
if not profile.user.is_active: if not profile.user.is_active:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment