diff options
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(): |
