fix: students should be able to access private batch if they are enrolled
This commit is contained in:
@@ -1197,7 +1197,11 @@ def get_batch_details(batch):
|
|||||||
batch_students = frappe.get_all(
|
batch_students = frappe.get_all(
|
||||||
"LMS Batch Enrollment", {"batch": batch}, pluck="member"
|
"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
|
return
|
||||||
|
|
||||||
batch_details = frappe.db.get_value(
|
batch_details = frappe.db.get_value(
|
||||||
|
|||||||
Reference in New Issue
Block a user