Remove unnecessary prefetches.

This commit is contained in:
Casper V. Kristensen 2020-01-07 00:05:28 +01:00
parent 84f3554d98
commit bb16c152c4
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -88,12 +88,8 @@ class RaidDetailView(SingleObjectMixin, MultiModelFormView):
def get_queryset(self): def get_queryset(self):
return Raid.objects.prefetch_related( return Raid.objects.prefetch_related(
"responses",
"responses__character",
"responses__character__user",
"responses__character__user__rank", "responses__character__user__rank",
"responses__character__user__main", "responses__character__user__main",
"comments",
"comments__user__main" "comments__user__main"
).all() ).all()
@ -161,7 +157,7 @@ class RaidChangeView(PermissionRequiredMixin, SingleObjectMixin, MultiModelFormV
} }
def get_queryset(self): def get_queryset(self):
return Raid.objects.prefetch_related("responses", "responses__character").all() return Raid.objects.all()
def get_raid_form_instance(self): def get_raid_form_instance(self):
return self.object return self.object