[FIX] HORILLA DOCUMENTS: Validation if max size not given
This commit is contained in:
@@ -84,9 +84,9 @@ class Document(models.Model):
|
|||||||
if file and self.document_request_id:
|
if file and self.document_request_id:
|
||||||
format = self.document_request_id.format
|
format = self.document_request_id.format
|
||||||
max_size = self.document_request_id.max_size
|
max_size = self.document_request_id.max_size
|
||||||
|
if max_size:
|
||||||
if file.size > max_size * 1024 * 1024:
|
if file.size > max_size * 1024 * 1024:
|
||||||
raise ValidationError("File size exceeds the limit")
|
raise ValidationError("File size exceeds the limit")
|
||||||
|
|
||||||
ext = file.name.split(".")[1].lower()
|
ext = file.name.split(".")[1].lower()
|
||||||
if format == "any":
|
if format == "any":
|
||||||
|
|||||||
Reference in New Issue
Block a user