ADD archivedet evaluvation
This commit is contained in:
@@ -5,7 +5,7 @@ from django_core.mixins import BaseViewSetMixin
|
||||
from django_filters.rest_framework import DjangoFilterBackend
|
||||
from drf_spectacular.utils import extend_schema, OpenApiParameter
|
||||
from rest_framework.filters import OrderingFilter, SearchFilter
|
||||
from rest_framework.generics import GenericAPIView
|
||||
from rest_framework.generics import GenericAPIView, ListAPIView
|
||||
from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
@@ -159,16 +159,14 @@ class AutoEvaluationListAppraisersView(GenericAPIView):
|
||||
return Response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
|
||||
@extend_schema(
|
||||
tags=["AutoEvaluation"],
|
||||
request=AutoEvaluationSerializer,
|
||||
)
|
||||
tags=["AutoEvaluation"],
|
||||
request=AutoEvaluationSerializer,
|
||||
)
|
||||
class AutoEvaluationRequestView(APIView):
|
||||
authentication_classes = []
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
|
||||
def post(self, request):
|
||||
serializer = AutoEvaluationSerializer(data=request.data)
|
||||
|
||||
@@ -183,3 +181,15 @@ class AutoEvaluationRequestView(APIView):
|
||||
"data": response.json(),
|
||||
})
|
||||
return Response({"error": serializer.errors}, status=400)
|
||||
|
||||
|
||||
@extend_schema(tags=["AutoEvaluation"])
|
||||
class GetArchivedEvaluation(ListAPIView):
|
||||
authentication_classes = []
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
def get_queryset(self):
|
||||
return AutoEvaluationModel.objects.filter(is_archived=True)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user