From 08a60653baff294324aaeb0963e00dbb60ace86f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 28 Jul 2015 09:22:36 +0530 Subject: [PATCH] [fix] [setup wizard] ignore if user is the primary user --- erpnext/setup/page/setup_wizard/setup_wizard.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 9ddd2dc03e..02b7e44422 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -542,13 +542,15 @@ def create_users(args): user.append_roles("Accounts Manager", "Accounts User") 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 emp = frappe.get_doc({ "doctype": "Employee", "full_name": fullname, - "user_id": user.name, + "user_id": email, "status": "Active", "company": args.get("company_name") })