Skip to content

Commit

Permalink
Replaced obsoleted Required() validator with DataRequired().
Browse files Browse the repository at this point in the history
  • Loading branch information
lingthio committed Aug 28, 2017
1 parent 8857bc0 commit 41342aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/source/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ A custom RegisterForm must be defined with field names
**exactly matching** the names of the model fields::

class MyRegisterForm(RegisterForm):
first_name = StringField('First name', validators=[Required('First name is required')])
last_name = StringField('Last name', validators=[Required('Last name is required')])
first_name = StringField('First name', validators=[DataRequired('First name is required')])
last_name = StringField('Last name', validators=[DataRequired('Last name is required')])

user_manager = UserManager(db_adapter, app, register_form=MyRegisterForm)

Expand Down
2 changes: 1 addition & 1 deletion flask_user/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def validate(self):

class InviteForm(FlaskForm):
email = StringField(_('Email'), validators=[
validators.Required(_('Email is required')),
validators.DataRequired(_('Email is required')),
validators.Email(_('Invalid Email'))])
next = HiddenField()
submit = SubmitField(_('Invite!'))

0 comments on commit 41342aa

Please sign in to comment.