mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-18 17:13:00 +08:00
Only allow hardcopy requests
This commit is contained in:
parent
ffff9f9d77
commit
6357899b70
1 changed files with 4 additions and 0 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Reference in a new issue