mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Allow setting the ASN on document upload
This commit is contained in:
parent
1471dd72a6
commit
bec8d00232
5 changed files with 50 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue