From df431165e89f247f111dd37e861b0a51fe9109b0 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Mon, 24 May 2021 12:57:01 +0530 Subject: [PATCH] feat: redirect non-members visiting any batch page to the course page --- community/www/batch/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/www/batch/utils.py b/community/www/batch/utils.py index 8f375248..24b5dd32 100644 --- a/community/www/batch/utils.py +++ b/community/www/batch/utils.py @@ -13,7 +13,7 @@ def get_common_context(context): return 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 raise frappe.Redirect