fix: only show the published courses on All Courses page

Closes #155
This commit is contained in:
Anand Chitipothu
2021-07-19 17:03:38 +05:30
parent 9be8a1af0b
commit 8a3e31f021

View File

@@ -5,7 +5,7 @@ def get_context(context):
context.courses = get_courses()
def get_courses():
course_names = frappe.get_all("LMS Course", pluck="name")
course_names = frappe.get_all("LMS Course", filters={"is_published": True}, pluck="name")
courses = []
for course in course_names:
courses.append(frappe.get_doc("LMS Course", course))