From 837d050628a25c86ad7e9cac5909bb96168b24db Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 14 Feb 2025 20:10:32 +0530 Subject: [PATCH] fix: students should be able to access private batch if they are enrolled --- lms/lms/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 04b85072..8ccbd4a0 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -1197,7 +1197,11 @@ def get_batch_details(batch): batch_students = frappe.get_all( "LMS Batch Enrollment", {"batch": batch}, pluck="member" ) - if not frappe.db.get_value("LMS Batch", batch, "published") and has_student_role() and frappe.session.user not in batch_students: + if ( + not frappe.db.get_value("LMS Batch", batch, "published") + and has_student_role() + and frappe.session.user not in batch_students + ): return batch_details = frappe.db.get_value(