feat: redirect non-members visiting any batch page to the course page
This commit is contained in:
@@ -13,7 +13,7 @@ def get_common_context(context):
|
|||||||
return
|
return
|
||||||
|
|
||||||
batch = course.get_batch(batch_name)
|
batch = course.get_batch(batch_name)
|
||||||
if not batch:
|
if not batch or not batch.is_member(frappe.session.user):
|
||||||
frappe.local.flags.redirect_location = "/courses/" + course_name
|
frappe.local.flags.redirect_location = "/courses/" + course_name
|
||||||
raise frappe.Redirect
|
raise frappe.Redirect
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user