Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bump WTForms and Flask-WTF to latest versions #4083

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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