fix: check if role exists before renaming

This commit is contained in:
Devin Slauenwhite
2024-04-30 20:27:29 -04:00
committed by GitHub
parent 0f64da69c0
commit 889bc2b1c7

View File

@@ -2,5 +2,5 @@ import frappe
def execute():
if frappe.db.exists("Role", "Class Evaluator"):
if frappe.db.exists("Role", "Class Evaluator") and not frappe.db.exists("Role", "Batch Evaluator"):
frappe.rename_doc("Role", "Class Evaluator", "Batch Evaluator")