[fix] catch max file size
This commit is contained in:
parent
894ee9d2d8
commit
af83117192
2 changed files with 5 additions and 0 deletions
|
|
@ -75,6 +75,7 @@ def get_bootinfo():
|
|||
|
||||
def load_conf_settings(bootinfo):
|
||||
from frappe import conf
|
||||
bootinfo.max_file_size = conf.get('max_file_size') or 3145728
|
||||
for key in ['developer_mode']:
|
||||
if key in conf: bootinfo[key] = conf.get(key)
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ frappe.request.call = function(opts) {
|
|||
508: function(xhr) {
|
||||
msgprint(__("Another transaction is blocking this one. Please try again in a few seconds."));
|
||||
},
|
||||
413: function(data, xhr) {
|
||||
msgprint(__("File size exceeded the maximum allowed size of {0} MB",
|
||||
[(frappe.boot.max_file_size || 3145728) / 1048576]))
|
||||
},
|
||||
417: function(data, xhr) {
|
||||
if(typeof data === "string") data = JSON.parse(data);
|
||||
opts.error_callback && opts.error_callback(data, xhr.responseText);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue