aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-10-08 15:52:12 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-10-08 15:52:12 +0200
commit75209aeed0140c804047b4f3466d329b9eb246b9 (patch)
tree51cbe453bc31e3418e050f0e780ac99e3c57ba92 /budget/forms.py
parent1338653bd2234a60eab368f58dcd8d2bcb3f3d6b (diff)
downloadihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.zip
ihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.tar.gz
ihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.tar.bz2
Add a password recovery feature. Fix #32
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/budget/forms.py b/budget/forms.py
index 499f382..cf5068b 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -87,6 +87,16 @@ class AuthenticationForm(Form):
submit = SubmitField("Get in")
+class PasswordReminder(Form):
+ id = TextField("Project identifier", validators=[Required()])
+ submit = SubmitField("Send me the code by email")
+
+ def validate_id(form, field):
+ if not Project.query.get(field.data):
+ raise ValidationError("This project does not exists")
+
+
+
class BillForm(Form):
date = DateField("Date", validators=[Required()], default=datetime.now)
what = TextField("What?", validators=[Required()])