diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index aa542ddfbf..2925469312 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(_("""Max strength must be greater than zero.""")) 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))