#224 Forms: Replace TextField with StringField to fix wtforms >= 3.0 compatibility
Merged 4 months ago by frantisekz. Opened 4 months ago by frantisekz.

@@ -20,7 +20,7 @@ 

  """Forms used in the application"""

  

  from flask_wtf import Form

- from wtforms import TextField, SelectField, BooleanField, IntegerField

+ from wtforms import StringField, SelectField, BooleanField, IntegerField

  from wtforms import TextAreaField, PasswordField, ValidationError

  from wtforms.validators import DataRequired, Email

  
@@ -32,7 +32,7 @@ 

  

  class BugProposeForm(Form):

      bugid = IntegerField(u'Bug ID', [DataRequired()])

-     bz_user = TextField(u'Bugzilla Login', [DataRequired(), Email()])

+     bz_user = StringField(u'Bugzilla Login', [DataRequired(), Email()])

      milestone = SelectField(u'Milestone', [DataRequired()], coerce=int)

      blocker = BooleanField(u'Blocker', [one_proposal])

      freeze_exception = BooleanField(u'Freeze Exception', [one_proposal])
@@ -40,5 +40,5 @@ 

  

  

  class FasBugzillaForm(Form):

-     bz_user = TextField(u'Login', [DataRequired(), Email()])

+     bz_user = StringField(u'Login', [DataRequired(), Email()])

      bz_pass = PasswordField(u'Password', [DataRequired()])

It seems it is a drop-in replacement, it exists in the 2.3 series too which is what we're using currently on prod.

Build succeeded.

From https://wtforms.readthedocs.io/en/3.0.x/whats_new/ :

The TextField alias for StringField is deprecated.

Seems OK! And since you said you tested it and it works, please push, ack. Thanks.

Pull-Request has been merged by frantisekz

4 months ago
Metadata