[fix] before_install returns False if setup wizard has been completed, fixes frappe/frappe#1488

This commit is contained in:
Rushabh Mehta 2015-12-31 11:12:48 +05:30
parent c57517b201
commit d55bdcf921
2 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,7 @@ web_include_css = "assets/erpnext/css/website.css"
setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete"
before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
after_install = "erpnext.setup.install.after_install"
boot_session = "erpnext.startup.boot.boot_session"

View File

@ -17,6 +17,14 @@ def after_install():
add_web_forms()
frappe.db.commit()
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
def feature_setup():
"""save global defaults and features setup"""
doc = frappe.get_doc("Features Setup", "Features Setup")