diff --git a/_updated/app/forms.py b/_updated/app/forms.py index 3b44cd68..12a5d74e 100644 --- a/_updated/app/forms.py +++ b/_updated/app/forms.py @@ -1,13 +1,13 @@ from flask_wtf import Form -from wtforms import TextField, PasswordField +from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, EqualTo, Length class RegisterForm(Form): - name = TextField( + name = StringField( 'Username', validators=[DataRequired(), Length(min=6, max=25)] ) - email = TextField( + email = StringField( 'Email', validators=[DataRequired(), Length(min=6, max=40)] ) password = PasswordField( @@ -21,11 +21,11 @@ class RegisterForm(Form): class LoginForm(Form): - name = TextField('Username', [DataRequired()]) + name = StringField('Username', [DataRequired()]) password = PasswordField('Password', [DataRequired()]) class ForgotForm(Form): - email = TextField( + email = StringField( 'Email', validators=[DataRequired(), Length(min=6, max=40)] ) diff --git a/forms.py b/forms.py index 3be12d82..27a3ce7b 100644 --- a/forms.py +++ b/forms.py @@ -1,15 +1,15 @@ from flask_wtf import Form -from wtforms import TextField, PasswordField +from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, EqualTo, Length # Set your classes here. class RegisterForm(Form): - name = TextField( + name = StringField( 'Username', validators=[DataRequired(), Length(min=6, max=25)] ) - email = TextField( + email = StringField( 'Email', validators=[DataRequired(), Length(min=6, max=40)] ) password = PasswordField( @@ -23,11 +23,11 @@ class RegisterForm(Form): class LoginForm(Form): - name = TextField('Username', [DataRequired()]) + name = StringField('Username', [DataRequired()]) password = PasswordField('Password', [DataRequired()]) class ForgotForm(Form): - email = TextField( + email = StringField( 'Email', validators=[DataRequired(), Length(min=6, max=40)] )