Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 1 | from __future__ import unicode_literals |
Chillar Anand | 915b343 | 2021-09-02 16:44:59 +0530 | [diff] [blame] | 2 | |
Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 3 | import frappe |
| 4 | |
Chillar Anand | 915b343 | 2021-09-02 16:44:59 +0530 | [diff] [blame] | 5 | import erpnext.education.utils as utils |
| 6 | |
Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 7 | no_cache = 1 |
| 8 | |
| 9 | def get_context(context): |
| 10 | context.education_settings = frappe.get_single("Education Settings") |
Shivam Mishra | b787415 | 2019-05-29 15:15:59 +0530 | [diff] [blame] | 11 | if not context.education_settings.enable_lms: |
| 12 | frappe.local.flags.redirect_location = '/' |
| 13 | raise frappe.Redirect |
Shivam Mishra | 823c795 | 2019-05-19 16:01:45 +0530 | [diff] [blame] | 14 | context.featured_programs = get_featured_programs() |
| 15 | |
| 16 | |
| 17 | def get_featured_programs(): |
Ankush Menat | 4551d7d | 2021-08-19 13:41:10 +0530 | [diff] [blame] | 18 | return utils.get_portal_programs() or [] |