From 8773dc3ffeee8b3e3d258d0b34a842bd328a88b7 Mon Sep 17 00:00:00 2001 From: Khushal Trivedi Date: Tue, 18 Feb 2020 19:37:21 +0530 Subject: [PATCH] fix: student max gropu cannot be zero or less than zero --- erpnext/education/doctype/student_group/student_group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index 9ec94384d5..c92c69b6b4 100644 --- a/erpnext/education/doctype/student_group/student_group.py +++ b/erpnext/education/doctype/student_group/student_group.py @@ -26,8 +26,8 @@ class StudentGroup(Document): frappe.throw(_("Please select Program")) def validate_strength(self): - if self.max_strength < 0: - frappe.throw(_("""Cannot enroll less than 0 students for this student group.""")) + if self.max_strength <= 0: + frappe.throw(_("""Cannot enroll less than or equal to 0 students for this student group.""")) if self.max_strength and len(self.students) > self.max_strength: frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))