2019-05-19 10:31:45 +00:00
|
|
|
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")
|
2019-05-29 09:45:59 +00:00
|
|
|
if not context.education_settings.enable_lms:
|
|
|
|
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():
|
2021-03-09 18:05:24 +00:00
|
|
|
return utils.get_portal_programs() or []
|