Skip to content

Commit

Permalink
Merge pull request #572 from tahir-zaqout/fix-instructors
Browse files Browse the repository at this point in the history
fix: course when instructor is not set
  • Loading branch information
pateljannat authored Aug 25, 2023
2 parents 7f67c6c + 86434ea commit 1676329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lms/lms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ 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(" ")
for instructor in instructors:
instructor_details.append(
frappe.db.get_value(
"User",
instructor.instructor,
instructor,
["name", "username", "full_name", "user_image"],
as_dict=True,
)
Expand Down

0 comments on commit 1676329

Please sign in to comment.