From 9a4b6de37d7417be7d3d2eff1ed48c671e33272b Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Tue, 25 May 2021 09:14:49 +0100 Subject: [PATCH] Bump utils version for new invalid address character --- app/main/forms.py | 2 +- app/templates/views/check/row-errors.html | 2 +- app/utils.py | 4 ++-- requirements.in | 2 +- requirements.txt | 2 +- tests/app/main/views/test_send.py | 4 ++-- tests/app/test_utils.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index ae85a7740..4f10c8032 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -1413,7 +1413,7 @@ class LetterAddressForm(StripWhitespaceForm): if address.has_invalid_characters: raise ValidationError( - 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < >' + 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < > ~' ) diff --git a/app/templates/views/check/row-errors.html b/app/templates/views/check/row-errors.html index 73f4e24fc..166692edd 100644 --- a/app/templates/views/check/row-errors.html +++ b/app/templates/views/check/row-errors.html @@ -85,7 +85,7 @@ Last line of the address must be a real UK postcode {% endif %} {% elif item.as_postal_address.has_invalid_characters %} - Address lines must not start with any of the following characters: @ ( ) = [ ] ” \ / , < > + Address lines must not start with any of the following characters: @ ( ) = [ ] ” \ / , < > ~ {% endif %} {% endcall %} diff --git a/app/utils.py b/app/utils.py index 31b89267e..59f52d585 100644 --- a/app/utils.py +++ b/app/utils.py @@ -559,11 +559,11 @@ LETTER_VALIDATION_MESSAGES = { 'invalid-char-in-address': { 'title': 'There’s a problem with the address for this letter', 'detail': ( - "Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < >" + "Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < > ~" ), 'summary': ( "Validation failed because address lines must not start with any of the " - "following characters: @ ( ) = [ ] ” \\ / , < >" + "following characters: @ ( ) = [ ] ” \\ / , < > ~" ), }, 'notify-tag-found-in-content': { diff --git a/requirements.in b/requirements.in index 8aa573757..ba9ab551e 100644 --- a/requirements.in +++ b/requirements.in @@ -26,7 +26,7 @@ fido2==0.9.1 awscli-cwlogs>=1.4,<1.5 itsdangerous==1.1.0 -git+https://github.com/alphagov/notifications-utils.git@44.2.0#egg=notifications-utils==44.2.0 +git+https://github.com/alphagov/notifications-utils.git@44.2.2#egg=notifications-utils==44.2.2 git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.8-alpha#egg=govuk-frontend-jinja==0.5.8-alpha # cryptography 3.4+ incorporates Rust code, which isn't supported on PaaS diff --git a/requirements.txt b/requirements.txt index eff53923b..044baf382 100644 --- a/requirements.txt +++ b/requirements.txt @@ -116,7 +116,7 @@ mistune==0.8.4 # via notifications-utils notifications-python-client==6.0.2 # via -r requirements.in -git+https://github.com/alphagov/notifications-utils.git@44.2.0#egg=notifications-utils==44.2.0 +git+https://github.com/alphagov/notifications-utils.git@44.2.2#egg=notifications-utils==44.2.2 # via -r requirements.in openpyxl==3.0.7 # via pyexcel-xlsx diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index fa9c8a3ba..ec9dacc33 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -733,7 +733,7 @@ def test_upload_csv_file_with_bad_postal_address_shows_check_page_with_errors( '6 Address must be no more than 7 lines long', '1 2 3 4 5 6 7 8', - '7 Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < >', + '7 Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < > ~', '=Firstname Lastname 123 Example St. SW1A 1AA', ] @@ -2370,7 +2370,7 @@ def test_send_one_off_letter_address_populates_address_fields_in_session( ( 'a\n(b\nSW1A 1AA', [], - 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < >', + 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < > ~', ), ]) def test_send_one_off_letter_address_rejects_bad_addresses( diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index 2b17f5866..52a7a4799 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -563,11 +563,11 @@ def test_get_letter_validation_error_for_unknown_error(): None, 'There’s a problem with the address for this letter', ( - 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < >' + 'Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / , < > ~' ), ( 'Validation failed because address lines must not start with any of the following ' - 'characters: @ ( ) = [ ] ” \\ / , < >' + 'characters: @ ( ) = [ ] ” \\ / , < > ~' ), ), ])