Fix head document requests endpoint

This commit is contained in:
Keannu Bernasol 2025-01-06 14:27:39 +08:00
parent 14f21bd2a8
commit d5477a1e1a
2 changed files with 3 additions and 2 deletions

View file

@ -124,7 +124,7 @@ class DocumentRequestSerializer(serializers.ModelSerializer):
class FullDocumentRequestSerializer(serializers.ModelSerializer):
documents = DocumentRequestUnitWithFileSerializer()
documents = DocumentRequestUnitWithFileSerializer(many=True)
requester = serializers.SlugRelatedField(
many=False,
slug_field="full_name",

View file

@ -7,6 +7,7 @@ from .serializers import (
DocumentRequestCreationSerializer,
DocumentRequestSerializer,
DocumentRequestUpdateSerializer,
FullDocumentRequestSerializer
)
from .models import DocumentRequest
@ -49,7 +50,7 @@ class DocumentRequestFullListView(generics.ListAPIView):
"""
http_method_names = ["get"]
serializer_class = DocumentRequestSerializer
serializer_class = FullDocumentRequestSerializer
pagination_class = PageNumberPagination
permission_classes = [IsAuthenticated, IsStaff]
queryset = DocumentRequest.objects.all()