From 6246cc84d51ab02007a8dca7bf6da6d9edd75202 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 24 Nov 2024 03:20:34 +0800 Subject: [PATCH] Update notify_email.py --- web/admin/setting/notify_email.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/admin/setting/notify_email.py b/web/admin/setting/notify_email.py index ce38e1cb4..9bd8b3f2b 100644 --- a/web/admin/setting/notify_email.py +++ b/web/admin/setting/notify_email.py @@ -31,8 +31,12 @@ import thisdb def get_notify_email(): notify_email = thisdb.getOptionByJson('notify_email', default={'open':False}, type='notify') - decrypt_data = mw.deDoubleCrypt('email', notify_email['cfg']) - notify_email['email'] = json.loads(decrypt_data) + if 'cfg' in notify_email: + decrypt_data = mw.deDoubleCrypt('email', notify_email['cfg']) + notify_email['email'] = json.loads(decrypt_data) + else: + notify_email['email'] = {'smtp_host':'','smtp_port':'','smtp_ssl':'','to_mail_addr':'','username':'','password':''} + return mw.returnData(True,'ok',notify_email)