From 33a84b1c23f7de45b4b6d4e1328f06f28dccdd4f Mon Sep 17 00:00:00 2001 From: "Nihantra C. Patel" <141945075+Nihantra-Patel@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:26:08 +0530 Subject: [PATCH] fix: Email Sent Twice (#27227) * fix: Email Sent Twice * fix: Email Sent Twice * fix: Email Sent Twice --- frappe/core/doctype/user/user.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index bc339432ec..225175e417 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -362,7 +362,11 @@ class User(Document): user=self.name, pwd=new_password, logout_all_sessions=self.logout_all_sessions ) - if not self.flags.no_welcome_mail and cint(self.send_welcome_email): + if ( + not self.flags.no_welcome_mail + and cint(self.send_welcome_email) + and not self.flags.email_sent + ): self.send_welcome_mail_to_user() self.flags.email_sent = 1 if frappe.session.user != "Guest":