diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index a7e5cf7669..e04e43051f 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -122,11 +122,20 @@ class User(Document): now = frappe.flags.in_test or frappe.flags.in_install self.send_password_notification(self.__new_password) frappe.enqueue( - "frappe.core.doctype.user.user.create_contact", user=self, ignore_mandatory=True, now=now + "frappe.core.doctype.user.user.create_contact", + user=self, + ignore_mandatory=True, + now=now, + enqueue_after_commit=True, ) if self.name not in STANDARD_USERS and not self.user_image: - frappe.enqueue("frappe.core.doctype.user.user.update_gravatar", name=self.name, now=now) + frappe.enqueue( + "frappe.core.doctype.user.user.update_gravatar", + name=self.name, + now=now, + enqueue_after_commit=True, + ) # Set user selected timezone if self.time_zone: