fix: no need to check if not in test before sending certificate email

This commit is contained in:
Jannat Patel
2025-12-10 14:11:08 +05:30
parent 7fc066679d
commit 631008832c

View File

@@ -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!")