feat: course settings from website

This commit is contained in:
Jannat Patel
2022-09-09 18:16:02 +05:30
parent 9dc10c3756
commit 212ed8e428
8 changed files with 43 additions and 16 deletions

View File

@@ -23,11 +23,14 @@ def get_context(context):
redirect_to_lesson(context.course, index_)
context.lesson = get_current_lesson_details(lesson_number, context)
instructor = is_instructor(context.course.name)
context.show_lesson = context.membership or context.lesson.include_in_preview or instructor or has_course_moderator_role()
if not context.lesson:
context.lesson = frappe._dict()
if frappe.form_dict.get("edit"):
if not is_instructor(context.course.name) and not has_course_moderator_role():
if not instructor and not has_course_moderator_role():
redirect_to_courses_list()
context.lesson.edit_mode = True
else: