fix: delete using before_uninstall hook
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user