Commit Graph

119 Commits

Author SHA1 Message Date
Chris Hill-Scott
a8bac328d2 Bump utils to 39.0.1
Fixes a bug with address validation.
2020-05-06 10:23:50 +01:00
Chris Hill-Scott
0c1373eeb5 Bump utils to 39.0.0
`allow_international_letters` is a new, required argument, so the tests
that make some `Row` objects need to provide that.

There are now 8 possible address columns (7 plus postcode) so the tests
need to expect that. But this won’t have any user-facing impact.
2020-05-01 14:37:24 +01:00
Chris Hill-Scott
ba0d330593 Allow countries in last line of addresses
For services that have permission to send international letters we
should not reject letters that are addressed to another country. We
should still reject letters that are badly-addressed.
2020-05-01 14:37:24 +01:00
Chris Hill-Scott
e366ad29ae Bump utils to 38.0.0
Brings in breaking change to how the `RecipientCSV` class should be
instantiated.
2020-05-01 14:37:23 +01:00
David McDonald
44155d4e7c Bring in utils to bump max fragments to 6 for SMS 2020-04-24 16:01:59 +01:00
David McDonald
1ff52bbaad Add GDSMetrics package
As per instructions https://github.com/alphagov/gds_metrics_python

The celery workers don't have an HTTP endpoint so no point in trying to
get prometheus to scrape them.
2020-04-20 18:39:45 +01:00
Pea Tyczynska
f27e544911 Make sure letter personalisation is string - pull utils patch 2020-04-17 13:42:57 +01:00
Chris Hill-Scott
5ddb5a75da Use new properties of utils Templates
We’ve added some new properties to the templates in utils that we can
use instead of doing weird things like
`WithSubjectTemplate.__str__(another_instance)`
2020-04-15 16:40:42 +01:00
Leo Hemsted
7fe075393d fix timezone related cancel letter job bug 2020-04-14 14:32:36 +01:00
Chris Hill-Scott
264fbed04e Refactor postcode validation to use utils
We don’t need to reformat the postcode here once template preview takes
care of it when rendering the PDF.

It’s better (and less code) to store what people give us, so we give
them back the same thing.
2020-04-09 18:19:53 +01:00
Katie Smith
7218e5887e Bump utils to 36.9.3 to bring in new version of Bleach 2020-03-31 09:13:24 +01:00
Pea Tyczynska
bf1cab76a9 Bump utils 2020-03-13 17:35:47 +00:00
Pea Tyczynska
1fb040dc61 Format postcode for CSV letter rows
We are formatting the postcode here, because if we did it in template
preview, that could break flows like API and admin one-off, since
we are not validating postcode there yet, and format_postcode
needs a nice validated postcode.

We are not doing it in admin, as then we would have to either
rewrite the CSV file or pass data differently to API. First would
be nasty, second is a lot of overhead.

In the long run we might want to move postcode formatting to
template preview so that the postcode in letter preview looks the same
before and after user sends it, but now to get it out quickly it's better
to format the postcode here in the task.
2020-03-13 17:35:36 +00:00
Rebecca Law
a994e8fb6e Update validators to use is_message_too_long()
- update check_sms_content_char_count to use the SMSTemplate.is_message_too_long function, and updated the error message to align with the message returned by the admin app.
- Update the the code used by version 1 of the api to use the validate_template method.
  - I did find a couple of services still using the old api, however, this change should not affect them as I checked the messages being sent and they are not too long.
  - We will be sending a message to them to see if they can upgrade.
- Update the log message for authenication to include the URL - makes it easier to track if a service is using version 1 of the api.
2020-03-10 09:38:16 +00:00
pyup-bot
6d22c8fe14 Update marshmallow-sqlalchemy from 0.22.2 to 0.22.3 2020-03-09 15:29:26 +00:00
pyup-bot
5efbdbd2a2 Update marshmallow from 2.20.2 to 2.20.5 2020-02-26 13:00:13 +00:00
pyup-bot
d203072e55 Update marshmallow-sqlalchemy from 0.21.0 to 0.22.2 2020-02-26 13:00:11 +00:00
pyup-bot
0d3cf41a90 Update flask-marshmallow from 0.10.1 to 0.11.0 2020-02-26 13:00:10 +00:00
pyup-bot
a4cba39f09 Update cffi from 1.13.2 to 1.14.0 2020-02-26 13:00:08 +00:00
Chris Hill-Scott
ee71dc7426 Bump utils to fix bleach security vulnerability 2020-02-25 11:02:41 +00:00
Leo Hemsted
9e84fb2a00 pin marshmallow to <v3
also, fix pyup comment syntax. descriptions in pyup comments need to
have an additional # prefix
2020-02-13 12:52:12 +00:00
pyup-bot
bbeb66398d pyup updates
Update cffi from 1.13.1 to 1.13.2
Update jsonschema from 3.1.1 to 3.2.0
Update marshmallow-sqlalchemy from 0.19.0 to 0.21.0
Update marshmallow from 2.20.2 to 3.4.0
Update sqlalchemy from 1.3.10 to 1.3.13
Update notifications-python-client from 5.4.1 to 5.5.1
2020-02-13 12:49:12 +00:00
David McDonald
5a3d2e3162 Use the original version of boto
We aren't aware of any reason we need to use our fork of boto anymore.
We therefore swap to use `celery[sqs]` which brings in the original
version of boto and we can remove our use of the fork.

This has been tested by running the celery app and seeing it connect to
sqs and grab messages off a queue.
2020-02-12 15:30:02 +00:00
Leo Hemsted
8d837eff0e bump gunicorn to v20
v20 brings in a host of changes, including a fix for
https://github.com/benoitc/gunicorn/issues/1847, which was stopping us
upgrading before
2020-02-04 14:21:56 +00:00
Katie Smith
1703ae6031 Bump utils to version 36.5.0
This version of utils has the Encryption module included in it.
2020-01-24 13:18:27 +00:00
Chris Hill-Scott
462a621256 Remove extraneous spacing characters from text messages
Brings in:
- [x] alphagov/notifications-utils#680
2019-12-18 11:24:09 +00:00
David McDonald
946ba993b5 Catch TokenAlgorithmError
Instead of letting it go uncaught and causing an error, we now show the
user an appropriate error message.
2019-12-12 10:23:28 +00:00
David McDonald
857550363c Bring in utils version 36.3.1
Fixes a formatting bug to templates
2019-12-09 15:54:28 +00:00
Leo Hemsted
6b9afa358f update utils to bring in full welsh diacritics range
note: this includes updating the MMG api url to their v2a api. Their
previous API doesn't include support for capital o with grave accent
(Ò)
2019-11-28 15:12:52 +00:00
Pea Tyczynska
c17100af37 Bump utils version and improve error message content 2019-11-26 11:19:01 +00:00
Leo Hemsted
5e9a21f5d0 bump requirements 2019-11-18 15:48:38 +00:00
Katie Smith
1d6716275a Bump utils to bring in changes to logging
Freezing the requirements changes the Werkzeug version to 0.16.0, which
requires a change in how we import an exception
(https://github.com/pallets/werkzeug/blob/master/CHANGES.rst#version-0160)
2019-10-28 10:54:19 +00:00
Leo Hemsted
51f90c17fd pin marshmallow and update flask error handling 2019-09-04 12:14:28 +01:00
Leo Hemsted
01c702535d freeze requirements and bump utils 2019-09-04 10:55:22 +01:00
pyup-bot
44872388a8 Update sqlalchemy from 1.3.3 to 1.3.8 2019-08-28 14:00:16 +01:00
pyup-bot
bbd82e9957 Update psycopg2-binary from 2.8.2 to 2.8.3 2019-08-28 14:00:14 +01:00
pyup-bot
b695bce284 Update marshmallow from 2.19.2 to 3.0.1 2019-08-28 14:00:13 +01:00
pyup-bot
7f32ed76b1 Update marshmallow-sqlalchemy from 0.16.3 to 0.17.0 2019-08-28 14:00:11 +01:00
pyup-bot
83e894a287 Update jsonschema from 3.0.1 to 3.0.2 2019-08-28 14:00:09 +01:00
pyup-bot
9bc886aad4 Update eventlet from 0.24.1 to 0.25.1 2019-08-28 14:00:08 +01:00
pyup-bot
b751393b53 Update flask from 1.0.2 to 1.1.1 2019-08-28 14:00:06 +01:00
pyup-bot
fd5bf4fb2a Update flask-migrate from 2.4.0 to 2.5.2 2019-08-28 14:00:05 +01:00
Athanasios Voutsadakis
cd936d2e71 Enable statsd exporter for production
Also bump the utils version to include a fix on the error handling logic
when we fail to send a metric.
2019-08-14 11:42:13 +01:00
Leo Hemsted
9726edf68d bump utils
also remove the `read().splitlines()` pattern from csv.reader usage,
as it's redundant. also add .vscode to gitignore to accomodate my
hipster IDE choices, and add some lines to pytest.ini so just running
`py.test` uses some useful flags
2019-08-02 12:41:03 +01:00
Katie Smith
3a9bc36b54 Bump utils to 33.2.4 2019-07-18 15:27:13 +01:00
Katie Smith
db95a8460b Bump utils to 33.2.3 2019-07-18 14:11:41 +01:00
Chris Hill-Scott
a87a8f3fc6 Bump utils to 33.2.2
Changes:
- https://github.com/alphagov/notifications-utils/compare/33.2.1...33.2.2
2019-07-15 15:16:38 +01:00
Chris Hill-Scott
a2e1c812b2 Bump utils to bring in changes to email HTML
Changes:
https://github.com/alphagov/notifications-utils/compare/33.1.0...33.2.1
2019-07-10 10:17:19 +01:00
Pea Tyczynska
090769a069 Pull cancellable job statuses from utils and fix tests 2019-07-01 15:45:03 +01:00
Katie Smith
284785a7d7 Bump utils to add alt text to email branding
Utils 33.0.0 adds alt text to email branding - the HTMLEmailTemplate now
initializes slightly differently as a result (with both `branding_name`
and `branding_text`).
2019-06-25 16:53:07 +01:00