From f3a6e30e6ab73a6f81df698cd9216ef565a32e22 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 8 Jul 2020 10:45:55 +0530 Subject: [PATCH] fix: Check if homepage is not setup-wizard The new desk changes sets the default homepage to 'workspace'. To avoid problem in the future, check if the value is not setup-wizard. Also throw an exception if the check passes, so it exits with error. --- erpnext/setup/install.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 74ff0ecfd8..44f26bfd4a 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -29,12 +29,12 @@ def after_install(): def check_setup_wizard_not_completed(): - if frappe.db.get_default('desktop:home_page') == 'desktop': - print() - print("ERPNext can only be installed on a fresh site where the setup wizard is not completed") - print("You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall") - print() - return False + if frappe.db.get_default('desktop:home_page') != 'setup-wizard': + message = """Cannot install ERPNext. + +ERPNext can only be installed on a fresh site where the setup wizard is not completed. +You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall""" + frappe.throw(message, exc=frappe.IncompatibleApp) def set_single_defaults():