fix: batch instructor should be linked to evaluator

This commit is contained in:
Jannat Patel
2025-06-05 12:58:12 +05:30
parent eb9b1c905d
commit 1a1cbd6ea1
6 changed files with 33 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
import frappe
def execute():
batch_instructors = frappe.get_all(
"Course Instructor",
{
"parenttype": "LMS Batch",
},
["name", "instructor", "parent"],
)
for instructor in batch_instructors:
if not frappe.db.exists(
"Course Evaluator",
{
"evaluator": instructor.instructor,
},
):
doc = frappe.new_doc("Course Evaluator")
doc.evaluator = instructor.instructor
doc.insert()