Created
June 24, 2014 13:01
-
-
Save sebdah/9b2089abadb720027c1b to your computer and use it in GitHub Desktop.
Password confirmation in WTForms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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