diff --git a/BackEnd/administration/views.py b/BackEnd/administration/views.py index c3bab255..4c9496dd 100644 --- a/BackEnd/administration/views.py +++ b/BackEnd/administration/views.py @@ -1,6 +1,5 @@ from django.http import JsonResponse from django.views import View -from django.db.models import Q from drf_spectacular.utils import ( extend_schema, OpenApiExample, @@ -37,8 +36,6 @@ from django_filters.rest_framework import DjangoFilterBackend from .filters import UsersFilter -from rest_framework.permissions import AllowAny - class UsersListView(ListAPIView): """ @@ -114,30 +111,12 @@ class ProfileStatisticsView(RetrieveAPIView): Count of companies """ queryset = Profile.objects.all() - permission_classes = [AllowAny] + permission_classes = [IsStaffUser] serializer_class = StatisticsSerializer def get_object(self): return {} - # def get_serializer_context(self): - # context = super().get_serializer_context() - # context["companies_count"] = ( - # self.get_queryset() - # .filter(Q(is_registered=True) | Q(is_startup=True)) - # .count() - # ) - # context["investors_count"] = ( - # self.get_queryset().filter(is_registered=True).count() - # ) - # context["startups_count"] = ( - # self.get_queryset().filter(is_startup=True).count() - # ) - # context["blocked_companies_count"] = ( - # self.get_queryset().filter(status='blocked').count() - # ) - # return context - @extend_schema( request=AutoModerationHoursSerializer,