From dccffa7857a336fedef835e5a5445d685d9a349c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Mar 2013 19:02:35 +0530 Subject: [PATCH] show size exceeded message in filemanager --- webnotes/utils/file_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webnotes/utils/file_manager.py b/webnotes/utils/file_manager.py index a939f91c03..71cb18370d 100644 --- a/webnotes/utils/file_manager.py +++ b/webnotes/utils/file_manager.py @@ -24,6 +24,7 @@ from __future__ import unicode_literals import webnotes import os, conf from webnotes.utils import cstr +from webnotes import _ class MaxFileSizeReachedError(webnotes.ValidationError): pass @@ -137,7 +138,8 @@ def check_max_file_size(content): max_file_size = getattr(conf, 'max_file_size', 1000000) if len(content) > max_file_size: - raise Exception, MaxFileSizeReachedError + webnotes.msgprint(_("File size exceeded the maximum allowed size"), + raise_exception=MaxFileSizeReachedError) def write_file(content): """write file to disk with a random name (to compare)"""