fix(enrollment): prevent unauthorised enrollments in paid courses

This commit is contained in:
raizasafeel
2026-04-01 13:43:40 +05:30
parent bb1b1f6adc
commit c3e3337de4

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