brotherton-erpnext/erpnext/www/lms/index.py

18 lines
409 B
Python
Raw Normal View History

2019-05-19 10:31:45 +00:00
import frappe
import erpnext.education.utils as utils
2019-05-19 10:31:45 +00:00
no_cache = 1
2022-03-28 13:22:46 +00:00
2019-05-19 10:31:45 +00:00
def get_context(context):
context.education_settings = frappe.get_single("Education Settings")
if not context.education_settings.enable_lms:
2022-03-28 13:22:46 +00:00
frappe.local.flags.redirect_location = "/"
raise frappe.Redirect
2019-05-19 10:31:45 +00:00
context.featured_programs = get_featured_programs()
def get_featured_programs():
return utils.get_portal_programs() or []