Skip to content

Instantly share code, notes, and snippets.

@sebdah
Created June 24, 2014 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebdah/9b2089abadb720027c1b to your computer and use it in GitHub Desktop.
Save sebdah/9b2089abadb720027c1b to your computer and use it in GitHub Desktop.
Password confirmation in WTForms
class UserForm(model_form(models.User)):
""" Extend the ModelForm from MongoEngine """
password = wtf.PasswordField(
'Password',
[
wtf.validators.Length(min=2),
wtf.Required(),
wtf.EqualTo('confirm', message='Passwords must match')
])
confirm = wtf.PasswordField('Repeat password')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment