fix: delete using before_uninstall hook

This commit is contained in:
Jannat Patel
2023-03-14 10:56:08 +05:30
parent 8201506c5f
commit ea9ca67d1e
2 changed files with 2 additions and 4 deletions

View File

@@ -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"

View File

@@ -44,7 +44,7 @@ def add_pages_to_nav():
).save()
def after_uninstall():
def before_uninstall():
delete_custom_fields()
delete_lms_roles()
@@ -59,7 +59,6 @@ def delete_lms_roles():
for role in roles:
if frappe.db.exists("Role", role):
frappe.db.delete("Role", role)
frappe.db.commit()
def set_default_home():
@@ -135,4 +134,3 @@ def delete_custom_fields():
for field in fields:
frappe.db.delete("Custom Field", {"fieldname": field})
frappe.db.commit()