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") |
| 9 | context.program = get_program(frappe.form_dict['name']) |
| 10 | |
| 11 | def get_program(program_name): |
| 12 | try: |
| 13 | return frappe.get_doc('Program', program_name) |
| 14 | except frappe.DoesNotExistError: |
| 15 | frappe.throw(_("Program {0} does not exist.".format(program_name))) |