Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 1 | from __future__ import unicode_literals |
| 2 | import erpnext.education.utils as utils |
| 3 | import frappe |
| 4 | |
| 5 | no_cache = 1 |
| 6 | |
| 7 | def get_context(context): |
| 8 | context.education_settings = frappe.get_single("Education Settings") |
Shivam Mishra | b787415 | 2019-05-29 15:15:59 +0530 | [diff] [blame] | 9 | if not context.education_settings.enable_lms: |
| 10 | frappe.local.flags.redirect_location = '/' |
| 11 | raise frappe.Redirect |
Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 12 | context.featured_programs = get_featured_programs() |
| 13 | |
| 14 | |
| 15 | def get_featured_programs(): |
Francisco Roldán | 894cff5 | 2021-03-09 15:05:24 -0300 | [diff] [blame] | 16 | return utils.get_portal_programs() or [] |