diff --git a/erpnext/patches/v8_0/disable_instructor_role.py b/erpnext/patches/v8_0/disable_instructor_role.py index 94ebd9cac6b..4ba78d172cb 100644 --- a/erpnext/patches/v8_0/disable_instructor_role.py +++ b/erpnext/patches/v8_0/disable_instructor_role.py @@ -12,6 +12,7 @@ def execute(): domains = frappe.db.sql_list("select domain from tabCompany") if "Education" not in domains: - role = frappe.get_doc("Role", "Instructor") - role.disabled = 1 - role.save(ignore_permissions=True) \ No newline at end of file + if frappe.db.exists("Role", "Instructor"): + role = frappe.get_doc("Role", "Instructor") + role.disabled = 1 + role.save(ignore_permissions=True) \ No newline at end of file