aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/budget/forms.py b/budget/forms.py
index 5abbd84..d0a60ca 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -120,6 +120,10 @@ class BillForm(Form):
def set_default(self):
self.payed_for.data = self.payed_for.default
+ def validate_amount(self, field):
+ if field.data < 0:
+ raise ValidationError(_("Bills can't be negative"))
+
class MemberForm(Form):