diff --git a/README.md b/README.md index 5006cd26..3ca1d7a5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ These are some of the tools it's built on: You need Docker, docker-compose, and git setup on your machine. Refer to [Docker documentation](https://docs.docker.com/). After that, run the following commands: ``` git clone https://github.com/frappe/lms -cd lms/docker +cd apps/lms/docker docker-compose up ``` diff --git a/lms/hooks.py b/lms/hooks.py index b3b065dd..c9078ef3 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -60,7 +60,7 @@ web_include_js = ["website.bundle.js"] # before_install = "lms.install.before_install" after_install = "lms.install.after_install" after_sync = "lms.install.after_sync" -after_uninstall = "lms.install.after_uninstall" +before_uninstall = "lms.install.before_uninstall" setup_wizard_requires = "assets/lms/js/setup_wizard.js" diff --git a/lms/install.py b/lms/install.py index 00ca4eea..b75b5518 100644 --- a/lms/install.py +++ b/lms/install.py @@ -44,8 +44,9 @@ def add_pages_to_nav(): ).save() -def after_uninstall(): +def before_uninstall(): delete_custom_fields() + delete_lms_roles() def create_lms_roles(): @@ -53,6 +54,13 @@ def create_lms_roles(): create_moderator_role() +def delete_lms_roles(): + roles = ["Course Creator", "Moderator"] + for role in roles: + if frappe.db.exists("Role", role): + frappe.db.delete("Role", role) + + def set_default_home(): frappe.db.set_value("Portal Settings", None, "default_portal_home", "/courses") @@ -126,4 +134,3 @@ def delete_custom_fields(): for field in fields: frappe.db.delete("Custom Field", {"fieldname": field}) - frappe.db.commit() diff --git a/lms/public/js/setup_wizard.js b/lms/public/js/setup_wizard.js index e6f362bf..81c6ba58 100644 --- a/lms/public/js/setup_wizard.js +++ b/lms/public/js/setup_wizard.js @@ -2,4 +2,4 @@ frappe.provide("lms.setup"); // redirect to desk page 'lms' after setup wizard is complete // 'lms' desk page redirects to '/courses' -frappe.setup.welcome_page = "/app/lms-home"; +//frappe.setup.welcome_page = "/app/lms-home";