diff --git a/erpnext/education/utils.py b/erpnext/education/utils.py index a35cedc8b0..3352b515f3 100644 --- a/erpnext/education/utils.py +++ b/erpnext/education/utils.py @@ -246,6 +246,8 @@ def get_student_topic_details(topic, course_name, program): :param course_name: """ student = get_current_student() + if not student: + return None course_enrollment = get_or_create_course_enrollment(course_name, program) progress = student.get_topic_progress(course_enrollment.name, topic) if not progress: diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index 34158c80fe..1182eb99da 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -85,7 +85,7 @@ {% block content %}
- {{ hero(course.course_name, course.course_intro, has_access) }} + {{ hero(course.course_name, course.course_intro, has_access, {'name': 'Program', 'url': '/lms/program?program=' + program }) }}
{% for topic in topics %} diff --git a/erpnext/www/lms/macros/hero.html b/erpnext/www/lms/macros/hero.html index 20e9d05c60..dfee93fa99 100644 --- a/erpnext/www/lms/macros/hero.html +++ b/erpnext/www/lms/macros/hero.html @@ -1,6 +1,11 @@ -{% macro hero(title, description, has_access) %} +{% macro hero(title, description, has_access, back) %}
-

{{ title }}

+ +

{{ title }}

{{ description }}

{% if frappe.session.user == 'Guest' %} diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html index 0ea2dbb462..a0e45e31fe 100644 --- a/erpnext/www/lms/program.html +++ b/erpnext/www/lms/program.html @@ -65,7 +65,7 @@ {% block content %}

- {{ hero(program.program_name, program.description, has_access) }} + {{ hero(program.program_name, program.description, has_access, {'name': 'LMS Home', 'url': '/lms'}) }}
{% for course in courses %}