diff --git a/frappe/desk/doctype/notification_log/notification_log.py b/frappe/desk/doctype/notification_log/notification_log.py index 90ae5a437e..f9f7e5967c 100644 --- a/frappe/desk/doctype/notification_log/notification_log.py +++ b/frappe/desk/doctype/notification_log/notification_log.py @@ -61,10 +61,6 @@ def enqueue_create_notification(users, doc): def make_notification_logs(doc, users): from frappe.social.doctype.energy_point_settings.energy_point_settings import is_energy_point_enabled - attachment = None - if doc.attachment: - attachment = doc.pop('attachment') - for user in users: if frappe.db.exists('User', user): if is_notifications_enabled(user): @@ -76,8 +72,6 @@ def make_notification_logs(doc, users): _doc.for_user = user _doc.subject = _doc.subject.replace('
', '').replace('
', '') if _doc.for_user != _doc.from_user or doc.type == 'Energy Point' or doc.type == 'Alert': - if attachment: - _doc.attached_file = json.dumps(attachment) _doc.insert(ignore_permissions=True) def send_notification_email(doc): diff --git a/frappe/email/doctype/notification/notification.py b/frappe/email/doctype/notification/notification.py index 06a76a2005..da8c247d9c 100644 --- a/frappe/email/doctype/notification/notification.py +++ b/frappe/email/doctype/notification/notification.py @@ -127,7 +127,7 @@ def get_context(context): self.send_a_slack_msg(doc, context) if self.channel == 'System Notification' or self.send_system_notification: - self.create_drodown_notification(doc, context) + self.create_system_notification(doc, context) if self.set_property_after_alert: allow_update = True @@ -147,7 +147,7 @@ def get_context(context): except Exception: frappe.log_error(title='Document update failed', message=frappe.get_traceback()) - def create_drodown_notification(self, doc, context): + def create_system_notification(self, doc, context): subject = self.subject if "{" in subject: subject = frappe.render_template(self.subject, context) @@ -162,7 +162,7 @@ def get_context(context): 'document_name': doc.name, 'subject': subject, 'email_content': frappe.render_template(self.message, context), - 'attachment': attachments and attachments[0] + 'attached_file': attachments and json.dumps(attachments[0]) } enqueue_create_notification(users, notification_doc)