Merge branch 'master' into edge

This commit is contained in:
Anand Doshi 2013-03-01 16:21:21 +05:30
commit fc7bb7d212
3 changed files with 8 additions and 6 deletions

View file

@ -104,7 +104,7 @@ wn.Application = Class.extend({
},
make_page_container: function() {
if($("#body_div").length) {
wn.temp_container = $("<div id='#temp-container' style='display: none;'>")
wn.temp_container = $("<div id='temp-container' style='display: none;'>")
.appendTo("body");
wn.container = new wn.views.Container();
}

View file

@ -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

View file

@ -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)"""