diff options
| author | Tinmn <royque@gmail.com> | 2011-11-20 14:37:32 +0100 |
|---|---|---|
| committer | Tinmn <royque@gmail.com> | 2011-11-20 14:37:32 +0100 |
| commit | a5cc50b0c245f55e15e8fc43feed90dbbc6ab771 (patch) | |
| tree | af215af3093020011f15ebcb34c5de36a1042b2e /budget/forms.py | |
| parent | 9962b6d60f7c193cbdd34e76f8d2b414a4fc675b (diff) | |
| download | ihatemoney-mirror-a5cc50b0c245f55e15e8fc43feed90dbbc6ab771.zip ihatemoney-mirror-a5cc50b0c245f55e15e8fc43feed90dbbc6ab771.tar.gz ihatemoney-mirror-a5cc50b0c245f55e15e8fc43feed90dbbc6ab771.tar.bz2 | |
Addition of an auto hiding user information message in the add user text field (with translation).
Diffstat (limited to 'budget/forms.py')
| -rw-r--r-- | budget/forms.py | 4 |
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(): |
