Shivam Mishra | d7e8298 | 2019-05-20 11:55:17 +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") |
| 9 | course = frappe.get_doc('Course', frappe.form_dict['name']) |
Shivam Mishra | 4991fca | 2019-05-30 16:37:15 +0530 | [diff] [blame] | 10 | context.program = frappe.form_dict['program'] |
Shivam Mishra | d7e8298 | 2019-05-20 11:55:17 +0530 | [diff] [blame] | 11 | context.course = course |
Shivam Mishra | 4991fca | 2019-05-30 16:37:15 +0530 | [diff] [blame] | 12 | context.topics = course.get_topics() |
| 13 | context.has_access = utils.allowed_program_access(context.program) |