diff --git a/docmanager_backend/document_requests/serializers.py b/docmanager_backend/document_requests/serializers.py index 396629a..c6cd5f2 100644 --- a/docmanager_backend/document_requests/serializers.py +++ b/docmanager_backend/document_requests/serializers.py @@ -24,7 +24,8 @@ class DocumentRequestCreationSerializer(serializers.ModelSerializer): documents = DocumentRequestUnitCreationSerializer(many=True, required=True) college = serializers.CharField(max_length=64) purpose = serializers.CharField(max_length=512) - type = serializers.ChoiceField(choices=DocumentRequest.TYPE_CHOICES, required=True) + type = serializers.ChoiceField( + choices=DocumentRequest.TYPE_CHOICES, required=True) class Meta: model = DocumentRequest @@ -73,6 +74,9 @@ class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer): class DocumentRequestSerializer(serializers.ModelSerializer): documents = serializers.SerializerMethodField() + requester = serializers.SlugRelatedField( + many=False, slug_field="email", queryset=CustomUser.objects.all(), required=False + ) purpose = serializers.CharField(max_length=512) date_requested = serializers.DateTimeField( format="%m-%d-%Y %I:%M %p", read_only=True