diff --git a/src/config/views.py b/src/config/views.py index 628906f6..e71e6812 100644 --- a/src/config/views.py +++ b/src/config/views.py @@ -12,10 +12,10 @@ class ConfigView(APIView): def get(self, request, name=None): if name is None: - if request.user.is_superuser: + if request.user.is_staff: return FormattedResponse(config.get_all()) return FormattedResponse(config.get_all_non_sensitive()) - if not config.is_sensitive(name) or request.is_superuser: + if not config.is_sensitive(name) or request.is_staff: return FormattedResponse(config.get(name)) return FormattedResponse(status=HTTP_403_FORBIDDEN) diff --git a/src/polaris/client.py b/src/polaris/client.py index 62a4dce3..28338c6f 100644 --- a/src/polaris/client.py +++ b/src/polaris/client.py @@ -91,7 +91,7 @@ def allocate_instance(challenge_id, user): 'user': str(user.id), 'team': str(user.team.id) }) - if not user.is_superuser: + if not user.is_staff: return censor_instance(response) return response @@ -102,7 +102,7 @@ def reallocate_instance(challenge_id, user): 'user': str(user.id), 'team': str(user.team.id) }) - if not user.is_superuser: + if not user.is_staff: return censor_instance(response) return response diff --git a/src/scorerecalculator/views.py b/src/scorerecalculator/views.py index 9d5ccc58..9840d865 100644 --- a/src/scorerecalculator/views.py +++ b/src/scorerecalculator/views.py @@ -6,7 +6,6 @@ from backend.response import FormattedResponse from challenge.models import Score -from config import config from team.models import Team diff --git a/src/team/views.py b/src/team/views.py index c20a9a35..c133a5da 100644 --- a/src/team/views.py +++ b/src/team/views.py @@ -63,10 +63,10 @@ class TeamViewSet(AdminListModelViewSet): def get_queryset(self): if self.action == "list": - if self.request.user.is_superuser: + if self.request.user.is_staff: return Team.objects.order_by("id").prefetch_related("members") return Team.objects.filter(is_visible=True).order_by("id").prefetch_related("members") - if self.request.user.is_superuser and not self.request.user.should_deny_admin(): + if self.request.user.is_staff and not self.request.user.should_deny_admin(): return Team.objects.order_by("id").prefetch_related( "solves", "members",