feat: edit existing lesson

This commit is contained in:
Jannat Patel
2023-05-03 17:41:18 +05:30
parent bbdfaa32e9
commit 4336839932
7 changed files with 168 additions and 44 deletions

View File

@@ -9,6 +9,10 @@ def get_context(context):
chapter_index = frappe.form_dict.get("chapter")
lesson_index = frappe.form_dict.get("lesson")
lesson_number = f"{chapter_index}.{lesson_index}"
context.lesson_index = lesson_index
context.chapter = frappe.db.get_value(
"Chapter Reference", {"idx": chapter_index, "parent": context.course.name}, "chapter"
)
context.lesson = get_current_lesson_details(lesson_number, context, True)
context.is_moderator = has_course_moderator_role()
instructor = is_instructor(context.course.name)