fix: students should be able to access private batch if they are enrolled

This commit is contained in:
Jannat Patel
2025-02-14 20:10:32 +05:30
parent 8b00bec49c
commit 837d050628

View File

@@ -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(