Allow setting the ASN on document upload

This commit is contained in:
Trenton Holmes
2023-02-19 16:38:34 -08:00
committed by Trenton H
parent 1471dd72a6
commit bec8d00232
5 changed files with 50 additions and 7 deletions

View File

@@ -691,6 +691,14 @@ class PostDocumentSerializer(serializers.Serializer):
required=False,
)
archive_serial_number = serializers.IntegerField(
label="ASN",
write_only=True,
required=False,
min_value=Document.ARCHIVE_SERIAL_NUMBER_MIN,
max_value=Document.ARCHIVE_SERIAL_NUMBER_MAX,
)
def validate_document(self, document):
document_data = document.file.read()
mime_type = magic.from_buffer(document_data, mime=True)