diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-10-18 18:13:54 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-10-18 18:13:54 +0200 |
| commit | b88b317faa8b462c3c932ed59903122a580ae825 (patch) | |
| tree | b6654438806a258ed642a3c30feefb8ef7962108 /budget/forms.py | |
| parent | 6e3834048b2b23a07afd5d2354b92131c2c175f9 (diff) | |
| download | ihatemoney-mirror-b88b317faa8b462c3c932ed59903122a580ae825.zip ihatemoney-mirror-b88b317faa8b462c3c932ed59903122a580ae825.tar.gz ihatemoney-mirror-b88b317faa8b462c3c932ed59903122a580ae825.tar.bz2 | |
Bills can't be negative. Fix #45
Diffstat (limited to 'budget/forms.py')
| -rw-r--r-- | budget/forms.py | 4 |
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): |
