fix: batch validations
This commit is contained in:
@@ -25,7 +25,7 @@ class LMSBatchEnrollment(Document):
|
||||
return
|
||||
|
||||
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."))
|
||||
|
||||
def validate_duplicate_members(self):
|
||||
|
||||
@@ -2068,7 +2068,7 @@ def enroll_in_batch(batch, payment_name=None):
|
||||
frappe.throw(_("The specified batch does not exist."))
|
||||
|
||||
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)
|
||||
validate_enrollment_eligibility(batch_doc, payment_doc)
|
||||
|
||||
Reference in New Issue
Block a user