Commit b718f6ba by Kálmán Viktor

dashboard: vm list performance upgrade

parent 8eb40129
......@@ -86,7 +86,12 @@
<span>{{ i.get_status_display }}</span>
</td>
<td>
{% include "dashboard/_display-name.html" with user=i.owner show_org=True %}
{% if i.owner.profile %}
{{ i.owner.profile.get_display_name }}
{% else %}
{{ i.owner.username }}
{% endif %}
{# include "dashboard/_display-name.html" with user=i.owner show_org=True #}
</td>
{% if user.is_superuser %}
<td class="node "data-sort-value="{{ i.node.normalized_name }}">
......
......@@ -1856,8 +1856,8 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
queryset = queryset.order_by(sort)
return queryset.filter(
**self.get_queryset_filters()).select_related('owner', 'node'
).distinct()
**self.get_queryset_filters()).prefetch_related(
"owner", "node", "owner__profile").distinct()
class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
......
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