Merge pull request #2283 from frappe/mergify/bp/main-hotfix/pr-2282

fix: prevent unauthorised enrollments in paid courses (backport #2282)
This commit is contained in:
Raizaaa
2026-04-01 15:17:49 +05:30
committed by GitHub

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}
):