mirror of
https://github.com/frappe/lms.git
synced 2026-04-19 22:52:29 +03:00
fix(enrollment): prevent unauthorised enrollments in paid courses
This commit is contained in:
@@ -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}
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user