reduced the preparation time of the user list on the backend (#2334)

main
Andrey Zhavoronkov 5 years ago committed by GitHub
parent 70e89d6f83
commit 2dcb9056e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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):

Loading…
Cancel
Save