blob: 782ac481a060905a93c9286eccd361c1598e77f1 [file] [log] [blame]
Shivam Mishra823c7952019-05-19 16:01:45 +05301import frappe
2
Chillar Anand915b3432021-09-02 16:44:59 +05303import erpnext.education.utils as utils
4
Shivam Mishra823c7952019-05-19 16:01:45 +05305no_cache = 1
6
Ankush Menat494bd9e2022-03-28 18:52:46 +05307
Shivam Mishra823c7952019-05-19 16:01:45 +05308def get_context(context):
9 context.education_settings = frappe.get_single("Education Settings")
Shivam Mishrab7874152019-05-29 15:15:59 +053010 if not context.education_settings.enable_lms:
Ankush Menat494bd9e2022-03-28 18:52:46 +053011 frappe.local.flags.redirect_location = "/"
Shivam Mishrab7874152019-05-29 15:15:59 +053012 raise frappe.Redirect
Shivam Mishra823c7952019-05-19 16:01:45 +053013 context.featured_programs = get_featured_programs()
14
15
16def get_featured_programs():
Ankush Menat4551d7d2021-08-19 13:41:10 +053017 return utils.get_portal_programs() or []