feat: multiple instructors on course card and course home

This commit is contained in:
Jannat Patel
2022-02-07 13:41:28 +05:30
parent 3e46db9c11
commit bf3a496ea3
7 changed files with 33 additions and 34 deletions

View File

@@ -1,4 +1,14 @@
import frappe
def execute():
frappe.get_all("LMS Course", fields=["name", "instructor"])
frappe.reload_doc("lms", "doctype", "lms_course")
courses = frappe.get_all("LMS Course", fields=["name", "instructor"])
for course in courses:
doc = frappe.get_doc({
"doctype": "Course Instructor",
"parent": course.name,
"parentfield": "instructors",
"parenttype": "LMS Course",
"instructor": course.instructor
})
doc.save()