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":