fix: misc issues

This commit is contained in:
Jannat Patel
2024-11-06 19:22:20 +05:30
parent 8004982e2e
commit 38e6e4345f
13 changed files with 185 additions and 39 deletions

View File

@@ -503,11 +503,6 @@ def first_lesson_exists(course):
return True
def redirect_to_courses_list():
frappe.local.flags.redirect_location = "/lms/courses"
raise frappe.Redirect
def has_course_instructor_role(member=None):
return frappe.db.get_value(
"Has Role",
@@ -1153,6 +1148,9 @@ def get_lesson(course, chapter, lesson):
lesson_details = frappe.db.get_value(
"Course Lesson", lesson_name, ["include_in_preview", "title"], as_dict=1
)
if not lesson_details:
return {}
membership = get_membership(course)
course_title = frappe.db.get_value("LMS Course", course, "title")
if (