From dc39b4ba130024f7c246e2110bd9b93a29ca8360 Mon Sep 17 00:00:00 2001 From: Khushal Trivedi Date: Sat, 15 Feb 2020 15:38:16 +0530 Subject: [PATCH] fix: validation on max group strength student group form --- erpnext/education/doctype/student_group/student_group.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index aa542ddfbf..9ec94384d5 100644 --- a/erpnext/education/doctype/student_group/student_group.py +++ b/erpnext/education/doctype/student_group/student_group.py @@ -26,6 +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 and len(self.students) > self.max_strength: frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))