fix(enrollment): prevent unauthorised enrollments in paid courses

(cherry picked from commit c3e3337de4)
This commit is contained in:
raizasafeel
2026-04-01 13:43:40 +05:30
committed by Mergify
parent 0e73afdee0
commit 1fb95b4234

View File

@@ -50,6 +50,11 @@ class LMSEnrollment(Document):
)
if self.enrollment_from_batch:
if not frappe.db.exists(
"Batch Course", {"parent": self.enrollment_from_batch, "course": self.course}
):
frappe.throw(_("This batch is not associated with this course."))
if frappe.db.exists(
"LMS Batch Enrollment", {"batch": self.enrollment_from_batch, "member": self.member}
):