From 2dcb9056e08229ee49ed76ffc6ee1eb16bbd6d62 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Mon, 19 Oct 2020 16:22:05 +0300 Subject: [PATCH] reduced the preparation time of the user list on the backend (#2334) --- cvat/apps/engine/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index 6e328f62..50798c73 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -714,7 +714,7 @@ class JobViewSet(viewsets.GenericViewSet, operation_summary='Method deletes a specific user from the server')) class UserViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin): - queryset = User.objects.all().order_by('id') + queryset = User.objects.prefetch_related('groups').all().order_by('id') http_method_names = ['get', 'post', 'head', 'patch', 'delete'] def get_serializer_class(self):