From 05e39992d01a310bb1d7752f4c165581e50f1843 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 2 Apr 2015 18:55:36 +0530 Subject: [PATCH] [setup-wizard] don't catch duplicate --- erpnext/setup/page/setup_wizard/install_fixtures.py | 10 +--------- erpnext/setup/page/setup_wizard/setup_wizard.py | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py index 8dbae537b1..3d583aa705 100644 --- a/erpnext/setup/page/setup_wizard/install_fixtures.py +++ b/erpnext/setup/page/setup_wizard/install_fixtures.py @@ -169,12 +169,4 @@ def install(country=None): parent_link_field = ("parent_" + scrub(doc.doctype)) if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field): doc.flags.ignore_mandatory = True - - try: - doc.insert() - except NameError, e: - if e.args[0] == r.get("doctype") and e.args[2] and e.args[2].args[0] == 1062: - # duplicate entry - pass - else: - raise + doc.insert() diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 11f326993c..3bd41fa357 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -440,8 +440,7 @@ def create_territories(): def login_as_first_user(args): if args.get("email") and hasattr(frappe.local, "login_manager"): - frappe.local.login_manager.user = args.get("email") - frappe.local.login_manager.post_login() + frappe.local.login_manager.login_as(args.get("email")) @frappe.whitelist() def load_messages(language):