fix: redirect to lms home if query params not set

This commit is contained in:
Shivam Mishra
2019-06-12 16:01:02 +05:30
parent 8d95c846e4
commit 147d5d9bf2
3 changed files with 24 additions and 7 deletions

View File

@@ -5,9 +5,13 @@ import frappe
no_cache = 1
def get_context(context):
course = frappe.form_dict['course']
program = frappe.form_dict['program']
topic = frappe.form_dict['topic']
try:
course = frappe.form_dict['course']
program = frappe.form_dict['program']
topic = frappe.form_dict['topic']
except KeyError:
frappe.local.flags.redirect_location = '/lms'
raise frappe.Redirect
context.program = program
context.course = course