fix: Email Sent Twice (#27227)

* fix: Email Sent Twice

* fix: Email Sent Twice

* fix: Email Sent Twice
This commit is contained in:
Nihantra C. Patel 2024-07-31 12:26:08 +05:30 committed by GitHub
parent 79dbe35fbc
commit 33a84b1c23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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":