Skip to content

Commit

Permalink
Merge pull request #4083 from alphagov/bump-wtforms
Browse files Browse the repository at this point in the history
Bump WTForms and Flask-WTF to latest versions
  • Loading branch information
quis authored Nov 30, 2021
2 parents 5e8d062 + b74fcf2 commit 80b645e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from wtforms import (
BooleanField,
DateField,
EmailField,
FieldList,
FileField,
HiddenField,
Expand All @@ -30,13 +31,14 @@
)
from wtforms import RadioField as WTFormsRadioField
from wtforms import (
SearchField,
SelectMultipleField,
StringField,
TelField,
TextAreaField,
ValidationError,
validators,
)
from wtforms.fields.html5 import EmailField, SearchField, TelField
from wtforms.validators import URL, DataRequired, Length, Optional, Regexp

from app.formatters import format_thousands, guess_name_from_email_address
Expand Down Expand Up @@ -542,7 +544,7 @@ def pre_validate(self, form):
try:
return super().pre_validate(form)
except ValueError:
raise ValueError(self.required_message)
raise ValidationError(self.required_message)


class StripWhitespaceForm(Form):
Expand Down
2 changes: 1 addition & 1 deletion app/main/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ValidEmail:

def __call__(self, form, field):

if field.data == '':
if not field.data:
return

try:
Expand Down
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ago==0.0.93
govuk-bank-holidays==0.8
humanize==3.12.0
Flask==1.1.2 # pyup: <2
Flask-WTF==0.15.1
Flask-WTF==1.0.0
wtforms==3.0.0
Flask-Login==0.5.0
werkzeug==2.0.2
jinja2==3.0.2
Expand Down
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ flask-login==0.5.0
# via -r requirements.in
flask-redis==0.4.0
# via notifications-utils
flask-wtf==0.15.1
flask-wtf==1.0.0
# via -r requirements.in
gds-metrics==0.2.4
# via -r requirements.in
Expand Down Expand Up @@ -225,8 +225,10 @@ werkzeug==2.0.2
# via
# -r requirements.in
# flask
wtforms==2.3.3
# via flask-wtf
wtforms==3.0.0
# via
# -r requirements.in
# flask-wtf
xlrd==1.2.0
# via pyexcel-xls
xlwt==1.3.0
Expand Down

0 comments on commit 80b645e

Please sign in to comment.