From 1d6add386a02d355d076d7c694ab9a67c277efef Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 24 Jan 2024 16:37:11 +0530 Subject: [PATCH] [FIX] HORILLA DOCUMENTS: Validation if max size not given --- horilla_documents/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/horilla_documents/models.py b/horilla_documents/models.py index c86cf51fd..f10c7cb02 100644 --- a/horilla_documents/models.py +++ b/horilla_documents/models.py @@ -84,9 +84,9 @@ class Document(models.Model): if file and self.document_request_id: format = self.document_request_id.format max_size = self.document_request_id.max_size - - if file.size > max_size * 1024 * 1024: - raise ValidationError("File size exceeds the limit") + if max_size: + if file.size > max_size * 1024 * 1024: + raise ValidationError("File size exceeds the limit") ext = file.name.split(".")[1].lower() if format == "any":