mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-18 17:13:00 +08:00
Return email instead of id in document_requests list view
This commit is contained in:
parent
7a29e0b737
commit
9198867346
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue