brotherton-erpnext/erpnext/www/lms/index.py
Francisco Roldán 894cff5aa4
fix: lms program and index missing context variables when is no data available (#24828)
* fix: program and index

* fix: moved default value to  get_course_progress
2021-03-09 23:35:24 +05:30

16 lines
446 B
Python

from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
no_cache = 1
def get_context(context):
context.education_settings = frappe.get_single("Education Settings")
if not context.education_settings.enable_lms:
frappe.local.flags.redirect_location = '/'
raise frappe.Redirect
context.featured_programs = get_featured_programs()
def get_featured_programs():
return utils.get_portal_programs() or []