Merge pull request #33 from nabinhait/master

admin_email_notification
This commit is contained in:
Rushabh Mehta 2011-09-05 05:56:01 -07:00
commit 1eac79dbf0
3 changed files with 26 additions and 2 deletions

View file

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

View file

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

View file

@ -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 + '<br><br>Login User: ' + webnotes.user.name + '<br><br>' + 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]])