Email Validator

This commit is contained in:
Emily 2019-05-28 20:10:21 +02:00
parent 05e7bae173
commit 4197f64cc8

View File

@ -1,5 +1,5 @@
from wtforms import Form, BooleanField, StringField, PasswordField, TextAreaField, validators
from wtforms.fields.html5 import DateField, DecimalField, IntegerField
from wtforms.fields.html5 import DateField, DecimalField, IntegerField, EmailField
from wtforms.widgets import TextArea
from flask_login import UserMixin
from flask_babel import gettext as _
@ -35,7 +35,7 @@ class ServiceForm(Form):
website = StringField(_("Website"), render_kw = FORM_RENDER_KW)
class LoginForm(Form):
email = StringField(_("Email"), [
email = EmailField(_("Email"), [
validators.DataRequired(),
validators.Length(min=6, max=254)
],
@ -48,7 +48,7 @@ class LoginForm(Form):
render_kw = FORM_RENDER_KW)
class RegisterForm(Form):
email = StringField(_("Email"), [
email = EmailField(_("Email"), [
validators.DataRequired(),
validators.Length(min=6, max=254)
],