From 14f21bd2a8f49f2b75630441243776b484196ec6 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 6 Jan 2025 14:17:40 +0800 Subject: [PATCH] Update document request serializer to return requester full name --- docmanager_backend/document_requests/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docmanager_backend/document_requests/serializers.py b/docmanager_backend/document_requests/serializers.py index 3dd3cf8..9b3f770 100644 --- a/docmanager_backend/document_requests/serializers.py +++ b/docmanager_backend/document_requests/serializers.py @@ -82,7 +82,7 @@ class DocumentRequestSerializer(serializers.ModelSerializer): ) requester = serializers.SlugRelatedField( many=False, - slug_field="email", + slug_field="full_name", queryset=CustomUser.objects.all(), ) purpose = serializers.CharField(max_length=512) @@ -127,7 +127,7 @@ class FullDocumentRequestSerializer(serializers.ModelSerializer): documents = DocumentRequestUnitWithFileSerializer() requester = serializers.SlugRelatedField( many=False, - slug_field="email", + slug_field="full_name", queryset=CustomUser.objects.all(), required=False, )