diff --git a/school/hooks.py b/school/hooks.py
index 391e73a1..929dbd4f 100644
--- a/school/hooks.py
+++ b/school/hooks.py
@@ -183,7 +183,8 @@ jinja = {
"school.lms.utils.get_reviews",
"school.lms.utils.is_eligible_to_review",
"school.lms.utils.get_initial_members",
- "school.lms.utils.get_sorted_reviews"
+ "school.lms.utils.get_sorted_reviews",
+ "school.lms.utils.is_instructor"
],
"filters": []
}
diff --git a/school/lms/utils.py b/school/lms/utils.py
index 51ec23c6..9246bc5a 100644
--- a/school/lms/utils.py
+++ b/school/lms/utils.py
@@ -81,7 +81,7 @@ def get_lesson_details(chapter):
for row in lesson_list:
lesson_details = frappe.db.get_value("Course Lesson", row.lesson,
- ["name", "title", "include_in_preview", "body"], as_dict=True)
+ ["name", "title", "include_in_preview", "body", "creation"], as_dict=True)
lesson_details.number = flt("{}.{}".format(chapter.idx, row.idx))
lessons.append(lesson_details)
return lessons
@@ -289,3 +289,6 @@ def get_initial_members(course):
member.member, ["name", "username", "full_name", "user_image"], as_dict=True))
return member_details
+
+def is_instructor(course):
+ return len(list(filter(lambda x: x.name == frappe.session.user, get_instructors(course)))) > 0
diff --git a/school/lms/widgets/CourseOutline.html b/school/lms/widgets/CourseOutline.html
index ab44b730..970de9ed 100644
--- a/school/lms/widgets/CourseOutline.html
+++ b/school/lms/widgets/CourseOutline.html
@@ -41,14 +41,14 @@
{% elif is_instructor and not lesson.include_in_preview %}