Commit e52cd2ff by Kálmán Viktor

dashboard: select related for template list

parent b718f6ba
......@@ -1726,14 +1726,15 @@ class TemplateList(LoginRequiredMixin, FilterMixin, SingleTableView):
def get_queryset(self):
logger.debug('TemplateList.get_queryset() called. User: %s',
queryset = self.create_acl_queryset(InstanceTemplate)
qs = self.create_acl_queryset(InstanceTemplate)
return queryset.filter(**self.get_queryset_filters()).distinct()
qs = qs.filter(**self.get_queryset_filters()).distinct()
except ValueError:
messages.error(self.request, _("Error during filtering."))
return queryset
return qs.select_related("lease", "owner", "owner__profile")
class TemplateDelete(LoginRequiredMixin, DeleteView):
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 sign in to comment