fix: batch instructor should be linked to evaluator
This commit is contained in:
22
lms/patches/v2_0/move_batch_instructors_to_evaluators.py
Normal file
22
lms/patches/v2_0/move_batch_instructors_to_evaluators.py
Normal 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()
|
||||
Reference in New Issue
Block a user