From c44290955e3e812cf3e87b26d9cc418b4b3d1fa3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 21 Oct 2017 11:20:18 +0530 Subject: [PATCH] Minor fix in patches (#11268) --- erpnext/patches/v8_0/disable_instructor_role.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v8_0/disable_instructor_role.py b/erpnext/patches/v8_0/disable_instructor_role.py index 94ebd9cac6..4ba78d172c 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