diff --git a/program/views.py b/program/views.py index 923d6f2f79a7c1e2e85c15932357b7828a8943bb..2e187cf60596c157c034d3ad9e23122e87a43788 100644 --- a/program/views.py +++ b/program/views.py @@ -32,7 +32,6 @@ from rest_framework.exceptions import ValidationError from rest_framework.pagination import LimitOffsetPagination from rest_framework.response import Response -from django.conf import settings from django.contrib.auth.models import User from django.db import IntegrityError from django.http import Http404, HttpResponse, JsonResponse @@ -266,12 +265,12 @@ class APIUserViewSet( search_fields = ["username", "first_name", "last_name", "email"] def get_queryset(self): - """The queryset contains all the users if the requesting user is a superuser or member of - the privileged group, otherwise it only contains the requesting user.""" + """The queryset contains all the users if the requesting user is a superuser, otherwise it + only contains the requesting user.""" user = self.request.user - if user.is_superuser or user.groups.filter(name=settings.PRIVILEGED_GROUP).exists(): + if user.is_superuser: return User.objects.all() else: return User.objects.filter(pk=user.id)