From 631008832c2c26649344220aea34f38644b7e09c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 10 Dec 2025 14:11:08 +0530 Subject: [PATCH] fix: no need to check if not in test before sending certificate email --- lms/lms/doctype/lms_certificate/lms_certificate.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.py b/lms/lms/doctype/lms_certificate/lms_certificate.py index a2f18abb..b1a60a63 100644 --- a/lms/lms/doctype/lms_certificate/lms_certificate.py +++ b/lms/lms/doctype/lms_certificate/lms_certificate.py @@ -19,12 +19,11 @@ class LMSCertificate(Document): self.name = make_autoname("hash", self.doctype) def after_insert(self): - if not frappe.in_test: - outgoing_email_account = frappe.get_cached_value( - "Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name" - ) - if outgoing_email_account or frappe.conf.get("mail_login"): - self.send_mail() + outgoing_email_account = frappe.get_cached_value( + "Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name" + ) + if outgoing_email_account or frappe.conf.get("mail_login"): + self.send_mail() def send_mail(self): subject = _("Congratulations on getting certified!")