diff --git a/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py b/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py index 89cf74efae..05b136de11 100644 --- a/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py +++ b/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py @@ -143,7 +143,12 @@ class DocType: for f in fld_list: if f[2] == 'Yes': if f[0].startswith('eval:'): - to_doc.fields[f[1]] = eval(f[0][5:]) + try: + val = eval(f[0][5:]) + except: + val = '' + + to_doc.fields[f[1]] = val else: to_doc.fields[f[1]] = obj.fields.get(f[0]) diff --git a/cgi-bin/webnotes/defs_template.py b/cgi-bin/webnotes/defs_template.py index 80e3113129..823edc0356 100644 --- a/cgi-bin/webnotes/defs_template.py +++ b/cgi-bin/webnotes/defs_template.py @@ -48,8 +48,26 @@ modules_path = '' # saved to the modules folder # developer_mode = 0 + +# +# Auto Clear Cache: If set, automatically clears cache on refresh +# + auto_cache_clear = 0 +# +# Admin Email Notification: If the admin_email_notification is set, +# then only sent notification email from the system +# + +admin_email_notification = 0 + +# +# Global Send Email: Global email settings, if 1 then only mail will go from the system +# + +global_send_email = 1 + # # Time Zone: Useful if your users are across timezones # diff --git a/cgi-bin/webnotes/modules/patch.py b/cgi-bin/webnotes/modules/patch.py index 5ecd84446c..816d760371 100644 --- a/cgi-bin/webnotes/modules/patch.py +++ b/cgi-bin/webnotes/modules/patch.py @@ -34,4 +34,5 @@ def write_log(): from webnotes.utils import sendmail subj = 'Error in running patches in %s' % webnotes.conn.cur_db_name msg = subj + '

Login User: ' + webnotes.user.name + '

' + webnotes.getTraceback() - sendmail(['developer@erpnext.com'], sender='automail@erpnext.com', subject= subj, parts=[['text/plain', msg]]) + if getattr(webnotes.defs,'admin_email_notification',0): + sendmail(['developers@erpnext.com'], sender='automail@erpnext.com', subject= subj, parts=[['text/plain', msg]])