diff --git a/docmanager_backend/document_requests/serializers.py b/docmanager_backend/document_requests/serializers.py index 7374558..2472e16 100644 --- a/docmanager_backend/document_requests/serializers.py +++ b/docmanager_backend/document_requests/serializers.py @@ -42,6 +42,10 @@ class DocumentRequestCreationSerializer(serializers.ModelSerializer): # Set requester to user who sent HTTP request to prevent spoofing 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_UNITS = []