feat: Moving to Jinja
This commit is contained in:
15
erpnext/www/lms/program.py
Normal file
15
erpnext/www/lms/program.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
import erpnext.education.utils as utils
|
||||
import frappe
|
||||
|
||||
no_cache = 1
|
||||
|
||||
def get_context(context):
|
||||
context.education_settings = frappe.get_single("Education Settings")
|
||||
context.program = get_program(frappe.form_dict['name'])
|
||||
|
||||
def get_program(program_name):
|
||||
try:
|
||||
return frappe.get_doc('Program', program_name)
|
||||
except frappe.DoesNotExistError:
|
||||
frappe.throw(_("Program {0} does not exist.".format(program_name)))
|
||||
Reference in New Issue
Block a user