From 4197f64cc89f4648662c2902173adb435a7ad2ce Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 28 May 2019 20:10:21 +0200 Subject: [PATCH] Email Validator --- forms/login.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/forms/login.py b/forms/login.py index 0b272b5..14ba8a0 100644 --- a/forms/login.py +++ b/forms/login.py @@ -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) ],