diff --git a/frappe/desk/doctype/notification_log/notification_log.py b/frappe/desk/doctype/notification_log/notification_log.py index 55d0f0f77a..96f1d5080a 100644 --- a/frappe/desk/doctype/notification_log/notification_log.py +++ b/frappe/desk/doctype/notification_log/notification_log.py @@ -54,13 +54,13 @@ def make_notification_logs(doc, users): if is_notifications_enabled(user): if doc.type == 'Energy Point' and not is_energy_point_enabled(): return - else: - _doc = frappe.new_doc('Notification Log') - _doc.update(doc) - _doc.for_user = user - _doc.subject = _doc.subject.replace('
', '').replace('
', '') - if _doc.for_user != _doc.from_user or doc.type == 'Energy Point': - _doc.insert(ignore_permissions=True) + + _doc = frappe.new_doc('Notification Log') + _doc.update(doc) + _doc.for_user = user + _doc.subject = _doc.subject.replace('
', '').replace('
', '') + if _doc.for_user != _doc.from_user or doc.type == 'Energy Point': + _doc.insert(ignore_permissions=True) def send_notification_email(doc): is_type_enabled = is_email_notifications_enabled_for_type(doc.for_user, doc.type) @@ -114,8 +114,8 @@ def get_title_html(title): @frappe.whitelist() def set_all_values_for_field(docnames, fieldname): docnames = frappe.parse_json(docnames) - event_name = 'all_' + fieldname - if docnames: + event_name = 'all_' + fieldname + if docnames: filters = {'name': ['in', docnames]} frappe.db.set_value('Notification Log', filters, fieldname, 1, update_modified=False) frappe.publish_realtime(event_name, after_commit=True, user=frappe.session.user) diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index 3ccbc3318c..0c41f19300 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -36,7 +36,7 @@ frappe.ui.Notifications = class Notifications { me.route_to_settings, __('Notification Settings'), [this.notifications_settings], - ) + ); this.setup_notifications(); this.bind_events(); @@ -47,12 +47,12 @@ frappe.ui.Notifications = class Notifications { 'frappe.desk.doctype.notification_settings.notification_settings.create_notification_settings'; return Promise.resolve() - .then(() => { - if (!settings_doc) return frappe.call(method); - }) - .then(() => { - frappe.set_route(`#Form/Notification Settings/${frappe.session.user}`); - }); + .then(() => { + if (!settings_doc) return frappe.call(method); + }) + .then(() => { + frappe.set_route(`#Form/Notification Settings/${frappe.session.user}`); + }); } setup_notifications() { @@ -389,10 +389,10 @@ frappe.ui.Notifications = class Notifications { : ''; let mark_all_read_html = category.value === 'Notifications' - ? ` - ${__('Mark all as Read')} - ` - : ''; + ? ` + ${__('Mark all as Read')} + ` + : ''; let html = `