From f939973d4f227207c6e5eee126ba01b03ee1e469 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 22 May 2025 12:03:07 +0530 Subject: [PATCH] fix: don't validate number of students if seat count is 0 in batch --- lms/lms/doctype/lms_batch/lms_batch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 046b7f7c..9052825e 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -103,7 +103,7 @@ class LMSBatch(Document): frappe.throw(_("Seat count cannot be negative.")) students = frappe.db.count("LMS Batch Enrollment", {"batch": self.name}) - if cint(self.seat_count) < students: + if cint(self.seat_count) and cint(self.seat_count) < students: frappe.throw(_("There are no seats available in this batch.")) def validate_timetable(self):