Merge pull request #572 from tahir-zaqout/fix-instructors

fix: course when instructor is not set
This commit is contained in:
Jannat Patel
2023-08-25 18:02:59 +05:30
committed by GitHub

View File

@@ -173,7 +173,7 @@ def get_tags(course):
def get_instructors(course):
instructor_details = []
instructors = frappe.get_all(
"Course Instructor", {"parent": course}, ["instructor"], order_by="idx"
"Course Instructor", {"parent": course}, order_by="idx", pluck="instructor"
)
if not instructors:
instructors = frappe.db.get_value("LMS Course", course, "owner").split(" ")
@@ -181,7 +181,7 @@ def get_instructors(course):
instructor_details.append(
frappe.db.get_value(
"User",
instructor.instructor,
instructor,
["name", "username", "full_name", "user_image"],
as_dict=True,
)