Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AuthorizationForm(Form):
- email = TextField(u'Email', [Required()])
- password = PasswordField(u'Password', [Required()])
- go = SubmitField(u'Go')
- def validate_email(form, field):
- if not bool(re.match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", field.data)):
- raise ValidationError('Name must be not empty')
- def validate_password(form, field):
- if not bool(re.match("(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,16})$", field.data)):
- raise ValidationError('Name must be not empty')
Add Comment
Please, Sign In to add comment