fix: batch validations

This commit is contained in:
Jannat Patel
2025-12-10 14:25:10 +05:30
parent 631008832c
commit 9470cc192c
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ class LMSBatchEnrollment(Document):
return return
roles = frappe.get_roles(self.owner) roles = frappe.get_roles(self.owner)
if not ("Moderator" in roles or "Batch Evaluator" in roles): if "Moderator" not in roles and "Batch Evaluator" not in roles:
frappe.throw(_("You must be a Moderator or Batch Evaluator to enroll users in a batch.")) frappe.throw(_("You must be a Moderator or Batch Evaluator to enroll users in a batch."))
def validate_duplicate_members(self): def validate_duplicate_members(self):

View File

@@ -2068,7 +2068,7 @@ def enroll_in_batch(batch, payment_name=None):
frappe.throw(_("The specified batch does not exist.")) frappe.throw(_("The specified batch does not exist."))
batch_doc = frappe.db.get_value( batch_doc = frappe.db.get_value(
"LMS Batch", batch, ["name", "seat_count", "allow_self_enrollment"], as_dict=True "LMS Batch", batch, ["name", "seat_count", "allow_self_enrollment", "paid_batch"], as_dict=True
) )
payment_doc = get_payment_details(payment_name) payment_doc = get_payment_details(payment_name)
validate_enrollment_eligibility(batch_doc, payment_doc) validate_enrollment_eligibility(batch_doc, payment_doc)