fix: batch switch with query parameters

This commit is contained in:
pateljannat
2021-06-22 10:11:21 +05:30
parent eb435261fe
commit 3384f974e5
17 changed files with 83 additions and 114 deletions

View File

@@ -16,9 +16,8 @@ def get_context(context):
raise frappe.Redirect
context.course = course
batch = course.get_student_batch(frappe.session.user)
if batch:
frappe.local.flags.redirect_location = f"/courses/{course.name}/learn"
raise frappe.Redirect
if not course.is_mentor(frappe.session.user):
batch = course.get_membership(frappe.session.user)
if batch:
frappe.local.flags.redirect_location = f"/courses/{course.name}/learn"
raise frappe.Redirect