diff --git a/community/www/courses/course.py b/community/www/courses/course.py index 3a2a19df..0bc2dded 100644 --- a/community/www/courses/course.py +++ b/community/www/courses/course.py @@ -11,9 +11,9 @@ def get_context(context): context.course_enrolled = has_enrolled(course_id) def get_course(name): - course = frappe.db.get_value('Community Course', name, + course = frappe.db.get_value('LMS Course', name, ['name', 'title', 'description'], as_dict=1) - course['topics'] = frappe.db.get_all('Community Course Topic', + course['topics'] = frappe.db.get_all('LMS Topic', filters={ 'course': name }, @@ -24,14 +24,13 @@ def get_course(name): @frappe.whitelist() def has_enrolled(course): - return frappe.db.get_value("Community Course Enrollment", {"course": course, "owner": frappe.session.user}) + return frappe.db.get_value("LMS Course Enrollment", {"course": course, "owner": frappe.session.user}) @frappe.whitelist() def enroll(course): return frappe.get_doc({ - "doctype": "Community Course Enrollment", + "doctype": "LMS Course Enrollment", "course": course, "user": frappe.session.user }).save() - \ No newline at end of file diff --git a/community/www/courses/index.py b/community/www/courses/index.py index 4ab1e92f..49b1864a 100644 --- a/community/www/courses/index.py +++ b/community/www/courses/index.py @@ -6,7 +6,7 @@ def get_context(context): def get_courses(): courses = frappe.get_all( - "Community Course", + "LMS Course", fields=['name', 'title', 'description'] ) - return courses \ No newline at end of file + return courses diff --git a/community/www/courses/topic.py b/community/www/courses/topic.py index 7b2b6cd4..500c9e98 100644 --- a/community/www/courses/topic.py +++ b/community/www/courses/topic.py @@ -17,14 +17,14 @@ def get_queryparam(name, redirect_when_not_found): def get_course(name): try: - course = frappe.get_doc('Community Course', name) + course = frappe.get_doc('LMS Course', name) except frappe.exceptions.DoesNotExistError: raise frappe.NotFound return course def get_topic(course_name, topic_name): try: - topic = frappe.get_doc('Community Course Topic', topic_name) + topic = frappe.get_doc('LMS Topic', topic_name) except frappe.exceptions.DoesNotExistError: raise frappe.NotFound if topic.course != course_name: