Only allow hardcopy requests

This commit is contained in:
Keannu Bernasol 2025-01-11 00:47:20 +08:00
parent ffff9f9d77
commit 6357899b70

View file

@ -42,6 +42,10 @@ class DocumentRequestCreationSerializer(serializers.ModelSerializer):
# Set requester to user who sent HTTP request to prevent spoofing # Set requester to user who sent HTTP request to prevent spoofing
validated_data["requester"] = user validated_data["requester"] = user
if validated_data["type"] == "softcopy":
raise serializers.ValidationError(
{"error": "Hardcopy requests are not accepted as of now"}
)
DOCUMENT_REQUEST = DocumentRequest.objects.create(**validated_data) DOCUMENT_REQUEST = DocumentRequest.objects.create(**validated_data)
DOCUMENT_REQUEST_UNITS = [] DOCUMENT_REQUEST_UNITS = []