From e9b7256992b295001b6dd5700a4f5b1e6a35373b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 21 Oct 2019 12:48:41 +0530 Subject: [PATCH] fix: get_email_header --- .../doctype/notification_log/notification_log.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frappe/desk/doctype/notification_log/notification_log.py b/frappe/desk/doctype/notification_log/notification_log.py index 0ba6e61c12..c88bfed5a4 100644 --- a/frappe/desk/doctype/notification_log/notification_log.py +++ b/frappe/desk/doctype/notification_log/notification_log.py @@ -77,12 +77,14 @@ def send_notification_email(doc): ) def get_email_header(doc): - if doc.type == 'Mention' or doc.type == 'Assignment': - return _('New {0}').format(doc.type) - elif doc.type == 'Share': - return _('New Document Shared') - elif doc.type == 'Energy Point': - return _('Energy Point Update') + return { + 'Default': _('New Notification'), + 'Mention': _('New Mention'), + 'Assignment': _('New Assignment'), + 'Share': _('New Document Shared'), + 'Energy Point': _('Energy Point Update'), + }[doc.type or 'Default'] + @frappe.whitelist() def mark_as_seen(docnames):