diff --git a/public/js/wn/app.js b/public/js/wn/app.js
index ce3bcecf00..a0213d29c2 100644
--- a/public/js/wn/app.js
+++ b/public/js/wn/app.js
@@ -104,7 +104,7 @@ wn.Application = Class.extend({
},
make_page_container: function() {
if($("#body_div").length) {
- wn.temp_container = $("
")
+ wn.temp_container = $("
")
.appendTo("body");
wn.container = new wn.views.Container();
}
diff --git a/webnotes/utils/email_lib/receive.py b/webnotes/utils/email_lib/receive.py
index f2c1befd02..100cf0a26e 100644
--- a/webnotes/utils/email_lib/receive.py
+++ b/webnotes/utils/email_lib/receive.py
@@ -97,14 +97,14 @@ class IncomingMail:
})
def save_attachments_in_doc(self, doc):
- from webnotes.utils.file_manager import save_file, add_file_list
+ from webnotes.utils.file_manager import save_file, add_file_list, MaxFileSizeReachedError
for attachment in self.attachments:
try:
fid = save_file(attachment['filename'], attachment['content'])
status = add_file_list(doc.doctype, doc.name, fid, fid)
- except:
- from webnotes.utils.scheduler import log
- log("receive.set_attachments_in_doc")
+ except MaxFileSizeReachedError:
+ # bypass max file size exception
+ pass
def get_thread_id(self):
import re
diff --git a/webnotes/utils/file_manager.py b/webnotes/utils/file_manager.py
index d92f810bff..a939f91c03 100644
--- a/webnotes/utils/file_manager.py
+++ b/webnotes/utils/file_manager.py
@@ -25,6 +25,8 @@ import webnotes
import os, conf
from webnotes.utils import cstr
+class MaxFileSizeReachedError(webnotes.ValidationError): pass
+
def upload():
# get record details
dt = webnotes.form_dict.doctype
@@ -135,7 +137,7 @@ def check_max_file_size(content):
max_file_size = getattr(conf, 'max_file_size', 1000000)
if len(content) > max_file_size:
- raise Exception, 'Maximum File Limit (%s MB) Crossed' % (int(max_file_size / 1000000))
+ raise Exception, MaxFileSizeReachedError
def write_file(content):
"""write file to disk with a random name (to compare)"""