aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
authorQuentin Roy <royque@gmail.com>2011-11-20 05:56:06 -0800
committerQuentin Roy <royque@gmail.com>2011-11-20 05:56:06 -0800
commit4d76f0886f18fb089f39c0ca713289f5d47da544 (patch)
treeaf215af3093020011f15ebcb34c5de36a1042b2e /budget/forms.py
parent9962b6d60f7c193cbdd34e76f8d2b414a4fc675b (diff)
parenta5cc50b0c245f55e15e8fc43feed90dbbc6ab771 (diff)
downloadihatemoney-mirror-4d76f0886f18fb089f39c0ca713289f5d47da544.zip
ihatemoney-mirror-4d76f0886f18fb089f39c0ca713289f5d47da544.tar.gz
ihatemoney-mirror-4d76f0886f18fb089f39c0ca713289f5d47da544.tar.bz2
Merge pull request #68 from Tinmn/master
Addition of an auto hiding user information message...
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/budget/forms.py b/budget/forms.py
index f5c3fb5..7d8d8e1 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -141,7 +141,7 @@ class BillForm(Form):
class MemberForm(Form):
- name = TextField(_("Name"), validators=[Required()])
+ name = TextField(_("Name"), validators=[Required()], default=_("Type user name here"))
submit = SubmitField(_("Add"))
def __init__(self, project, *args, **kwargs):
@@ -149,6 +149,8 @@ class MemberForm(Form):
self.project = project
def validate_name(form, field):
+ if field.data == form.name.default:
+ raise ValidationError(_("User name incorrect"))
if Person.query.filter(Person.name == field.data)\
.filter(Person.project == form.project)\
.filter(Person.activated == True).all():