mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: validation on max group strength student group form
This commit is contained in:
@@ -26,6 +26,8 @@ class StudentGroup(Document):
|
|||||||
frappe.throw(_("Please select Program"))
|
frappe.throw(_("Please select Program"))
|
||||||
|
|
||||||
def validate_strength(self):
|
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:
|
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))
|
frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user