Merge pull request #1625 from anandpdoshi/hotfix

Added hook: setup_wizard_exception
This commit is contained in:
Pratik Vyas 2014-05-12 12:53:38 +05:30
commit b2ce9c5487

View File

@ -15,6 +15,7 @@ import install_fixtures
@frappe.whitelist() @frappe.whitelist()
def setup_account(args=None): def setup_account(args=None):
try:
frappe.clear_cache() frappe.clear_cache()
if frappe.db.sql("select name from tabCompany"): if frappe.db.sql("select name from tabCompany"):
@ -24,6 +25,7 @@ def setup_account(args=None):
args = frappe.local.form_dict args = frappe.local.form_dict
if isinstance(args, basestring): if isinstance(args, basestring):
args = json.loads(args) args = json.loads(args)
args = frappe._dict(args) args = frappe._dict(args)
if args.language != "english": if args.language != "english":
@ -74,7 +76,12 @@ def setup_account(args=None):
frappe.clear_cache() frappe.clear_cache()
frappe.db.commit() frappe.db.commit()
except:
traceback = frappe.get_traceback()
for hook in frappe.get_hooks("setup_wizard_exception"):
frappe.get_attr(hook)(traceback, args)
raise
def update_user_name(args): def update_user_name(args):
if args.get("email"): if args.get("email"):