Commit e52cd2ff by Kálmán Viktor

dashboard: select related for template list

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