fix: delete custom fields after app in uninstalled

This commit is contained in:
Jannat Patel
2022-10-06 18:08:27 +05:30
parent e780a6fc7c
commit c0c9b50a5f
2 changed files with 19 additions and 1 deletions

View File

@@ -60,7 +60,8 @@ web_include_js = ["website.bundle.js", "controls.bundle.js"]
# ------------
# before_install = "lms.install.before_install"
# after_install = "lms.install.after_install"
after_uninstall = "lms.install.after_uninstall"
# Desk Notifications
# ------------------

17
lms/install.py Normal file
View File

@@ -0,0 +1,17 @@
import frappe
def after_uninstall():
delete_custom_fields()
def delete_custom_fields():
fields = [ "user_category", "headline", "college", "city", "verify_terms", "country", "preferred_location",
"preferred_functions", "preferred_industries", "work_environment_column", "time", "role", "carrer_preference_details",
"skill", "certification_details", "internship", "branch", "github", "medium", "linkedin", "profession", "looking_for_job",
"work_environment", "dream_companies", "career_preference_column", "attire", "collaboration", "location_preference",
"company_type", "skill_details", "certification", "education", "work_experience", "education_details", "hide_private",
"work_experience_details", "profile_complete", "cover_image"
]
for field in fields:
frappe.db.delete("Custom Field", {"fieldname": field})
frappe.db.commit()