fix: Wait for user creation before creating contact (#20022)
closes https://github.com/frappe/frappe/issues/19995
This commit is contained in:
parent
e9c57ee76e
commit
1cc51e6bb0
1 changed files with 11 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue