[fix] [setup wizard] ignore if user is the primary user
This commit is contained in:
parent
0c7fd6cd94
commit
08a60653ba
@ -542,13 +542,15 @@ def create_users(args):
|
|||||||
user.append_roles("Accounts Manager", "Accounts User")
|
user.append_roles("Accounts Manager", "Accounts User")
|
||||||
|
|
||||||
user.flags.delay_emails = True
|
user.flags.delay_emails = True
|
||||||
user.insert(ignore_permissions=True)
|
|
||||||
|
if not frappe.db.get_value("User", email):
|
||||||
|
user.insert(ignore_permissions=True)
|
||||||
|
|
||||||
# create employee
|
# create employee
|
||||||
emp = frappe.get_doc({
|
emp = frappe.get_doc({
|
||||||
"doctype": "Employee",
|
"doctype": "Employee",
|
||||||
"full_name": fullname,
|
"full_name": fullname,
|
||||||
"user_id": user.name,
|
"user_id": email,
|
||||||
"status": "Active",
|
"status": "Active",
|
||||||
"company": args.get("company_name")
|
"company": args.get("company_name")
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user