From 2e4b83f8480682d5c83f4ac9bfb4f9710325f591 Mon Sep 17 00:00:00 2001 From: Sugesh393 Date: Tue, 15 Oct 2024 13:10:45 +0530 Subject: [PATCH] fix: get_doc is not usable on jinja template in notification --- frappe/email/doctype/notification/notification.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/email/doctype/notification/notification.py b/frappe/email/doctype/notification/notification.py index a754f9175f..b1e945af93 100644 --- a/frappe/email/doctype/notification/notification.py +++ b/frappe/email/doctype/notification/notification.py @@ -734,11 +734,12 @@ def evaluate_alert(doc: Document, alert, event=None): def get_context(doc): - Frappe = namedtuple("frappe", ["utils"]) + Frappe = namedtuple("frappe", ["frappe"]) + frappe = Frappe(frappe=get_safe_globals().get("frappe")) return { "doc": doc, "nowdate": nowdate, - "frappe": Frappe(utils=get_safe_globals().get("frappe").get("utils")), + "frappe": frappe.frappe, }