fix: don't validate number of students if seat count is 0 in batch

This commit is contained in:
Jannat Patel
2025-05-22 12:03:07 +05:30
parent 63f327733e
commit f939973d4f

View File

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