Commit Graph

7880 Commits

Author SHA1 Message Date
pyup-bot
8cf92bd8d8 Update gds-metrics from 0.2.2 to 0.2.4 2020-08-18 09:58:36 +01:00
pyup-bot
695aefc014 Update prometheus-client from 0.7.1 to 0.8.0 2020-08-18 09:58:36 +01:00
pyup-bot
8faa8392e6 Update notifications-python-client from 5.5.1 to 5.7.0 2020-08-18 09:58:36 +01:00
pyup-bot
d8b5d99c4b Update cachetools from 4.1.0 to 4.1.1 2020-08-18 09:58:36 +01:00
pyup-bot
70f070e6b5 Update sqlalchemy from 1.3.17 to 1.3.18 2020-08-18 09:58:36 +01:00
pyup-bot
92fb28e6ec Update marshmallow-sqlalchemy from 0.23.0 to 0.23.1 2020-08-18 09:58:36 +01:00
pyup-bot
5dbc6fac3f Update flask-marshmallow from 0.11.0 to 0.13.0 2020-08-18 09:58:36 +01:00
pyup-bot
231fca04ec Update cffi from 1.14.0 to 1.14.1 2020-08-18 09:58:36 +01:00
David McDonald
db0655472a Merge pull request #2957 from alphagov/missing-template-version
Fix bug with missing template version param
2020-08-17 17:33:29 +01:00
David McDonald
7b5f4ad156 Fix bug with missing template version param
We were asking for the latest version of a letter template rather than
the version that the notification was sent with. This mean that if you
previewed a letter and had made edits to the template since it was sent
you would be shown an incorrect preview.
2020-08-17 15:30:16 +01:00
Leo Hemsted
ca3a3e8a05 Merge pull request #2944 from alphagov/send-events
Send events
2020-08-17 12:38:28 +01:00
Leo Hemsted
2e8a7c2444 move dao_create/dao_update fn to dao_utils
they're totally generic anyway
2020-08-14 17:41:44 +01:00
Leo Hemsted
bdf2253298 send broadcast events rather than messages
use the new endpoint from cbc proxy. create a new task that just
serializes the event and sends it across rather than sending a template
and the broadcast message.

some changes to serialize to make it json friendly etc. it also expects
sent_at and transmitted_finishes_at to always be set (we set them in the
code but don't enforce it n the DB right now), as they're required by
utils template. not sure whether we'll update db constraints to be more
strict or utils template to be more permissive just yet, wait until we
find out more about the requirements of the CBCs we integrate with.
2020-08-14 17:41:44 +01:00
Leo Hemsted
1c48e2efb2 reqs bump 2020-08-14 10:47:28 +01:00
Leo Hemsted
6fda3707a3 save broadcast events when sending a message, also send cancel messages 2020-08-14 10:47:28 +01:00
David McDonald
f1940cbd30 Merge pull request #2956 from alphagov/ses-throttle
Log warning for SES send rate throttling rather than exception
2020-08-14 10:19:44 +01:00
David McDonald
36614e5492 Log warning for SES send rate throttling rather than exception
We have hit throttling limits from SES approximately once a week during
a spike of traffic from GOV.UK. The rate limiting usually only lasts a
couple of minutes but generates enough exceptions to cause a p1 but with
no potential action for the responder.

Therefore we downgrade the warning for this case to a warning and assume
traffic will level back out such that the problem resolves itself.

Note, we will still get exceptions if we go over our daily limit, rather
than our per minute sending limit, which does require immediate action
by someone responding.

If we were to continually go over our per second sending rate for a long
continous period of time, then there is a chance we may not be aware but
given the risk of this happening is low I think it's an acceptable risk
for the moment.
2020-08-13 17:51:09 +01:00
Katie Smith
ff0e655838 Merge pull request #2955 from alphagov/invite-error-msg
Fix error message when invitation has expired
2020-08-13 10:17:47 +01:00
Katie Smith
f47e9116d6 Delete test for Redis config in sandbox
We don't use separate config per environment for Redis now.
2020-08-13 09:54:03 +01:00
Rebecca Law
59200b241e Add international_letters service permission for all services. 2020-08-13 09:17:18 +01:00
Katie Smith
fb36404b6c Fix error message when invitation has expired
The error message for when an invitation to Notify had expired was
displaying in admin with square brackets round it because admin is not
expecting the message to be a list
(a85134ee22/app/models/user.py (L500))
2020-08-12 18:30:00 +01:00
Rebecca Law
d9fd541ab7 Add international letters as a default permission when creating a new service 2020-08-11 15:59:09 +01:00
David McDonald
e91252ad43 Merge pull request #2952 from alphagov/turn-redis-back-on
Turn redis back on
2020-08-11 15:20:20 +01:00
David McDonald
2daa945ef6 Turn redis back on 2020-08-11 14:21:57 +01:00
David McDonald
1a9c9c636f Merge pull request #2949 from alphagov/turn-redis-off
Turn redis off
2020-08-11 14:05:19 +01:00
David McDonald
7b6bd21f19 Turn off redis for cred rotation
Short turn off in all environments to enable us to rotate creds. We will
then immediately follow up with enabling it back on.
2020-08-10 10:38:56 +01:00
David McDonald
6f66a63d67 Remove unneeded hardcoding of REDIS_ENABLED
This keeps things consistent with the live environment and also how we
do it for the admin app where it is entirely up to environment variables
whether redis is enabled or not. This changes nothing in terms of
functionality as currently in our environment variables redis is enabled
for the API in staging.
2020-08-10 10:36:11 +01:00
Rebecca Law
7976cefc34 Merge pull request #2948 from alphagov/csv-international-letters
Set postage and international for letters uploaded with a CSV
2020-08-10 10:07:41 +01:00
Rebecca Law
89a8d8912a Set postage and international for letters uploaded with a CSV
If the letter is outside of the United Kingdom, set the postage and international flag.
2020-08-10 09:58:49 +01:00
Rebecca Law
725ce38a06 Merge pull request #2943 from alphagov/international-postage
Set international postage and international flag for international letters
2020-08-10 08:22:52 +01:00
Leo Hemsted
b11e0051b7 Merge pull request #2947 from alphagov/trial-broadcast
allow trial mode service users to approve their own broadcasts
2020-08-06 12:17:21 +01:00
Leo Hemsted
05791f22a6 allow trial mode service users to approve their own broadcasts
we won't let trial mode services send real broadcasts, and it's helpful
for users to see the flow of messages without having to have a second
person with them
2020-08-06 11:15:49 +01:00
Rebecca Law
4a9f9e4b17 Remove the template_postage parameter for persist_notification
It was confusing to have 2 differnt postage parameters.
2020-08-06 07:35:13 +01:00
Chris Hill-Scott
c4e5123b92 Merge pull request #2942 from alphagov/remove-whitelist-urls
Remove whitelist from URLs
2020-08-04 14:15:36 +01:00
Chris Hill-Scott
929e1fbbdc Remove whitelist from URLs
The admin app is now[1] using the newer, `…/guest-list` URLs, so we can
remove the older, deprecated, `…/whitelist` ones.

***

1. https://github.com/alphagov/notifications-admin/pull/3536
2020-08-03 17:13:26 +01:00
Chris Hill-Scott
32f5f454de Merge pull request #2928 from alphagov/serve-on-slash-guest-list
Rename API URLs for guest list to guest list
2020-08-03 16:44:41 +01:00
Rebecca Law
10fe7d9fe8 Add postage for send-one-off letters.
The postage is set to europe or rest-of-world for international letters, otherwise the template postage is used.

Also set international for letters.
2020-08-03 14:01:59 +01:00
Rebecca Law
ed5e73d548 Set postage for templated letters when the address is not from the united-kingdom.
If the address is from the united-kingdom use the postage from the template.
2020-08-03 12:03:35 +01:00
Katie Smith
8e1fa6ab50 Merge pull request #2940 from alphagov/bump-eventlet
Bump eventlet
2020-07-31 10:51:26 +01:00
Katie Smith
baebc5bdaf Bump eventlet
dnspython had been changed from 1.16.0 to 2.0.0 in a previous commit,
but this was not compatible with eventlet 0.25.2. This bumps eventlet to
a later version, which has the effect of downgrading dnspython again.
2020-07-31 10:36:09 +01:00
Katie Smith
475678a5e5 Merge pull request #2938 from alphagov/more-letter-validation
Check for invalid characters in letter addresses
2020-07-31 09:10:00 +01:00
Katie Smith
c9f663fe76 Check for invalid chars in letter addresses when sending through the API
This uses the new method in notifications-utils to validate for invalid
characters in address blocks.
2020-07-31 08:58:56 +01:00
Katie Smith
4931fc396c Bump utils to 40.6.0
This brings in validation for invalid characters in address lines.
2020-07-31 08:58:56 +01:00
Rebecca Law
fbdae0ce30 Merge pull request #2937 from alphagov/indexes-for-notification_history
This migration will bring all environments in line with the prod
2020-07-30 08:28:35 +01:00
Rebecca Law
180ed86a27 This migration will bring all environments in line with the prod.
There are a few indexes that we still need to drop from prod notification_history. Indexes on prod can take too long to run in a migration so we need to run them manually.
2020-07-30 07:46:51 +01:00
Leo Hemsted
1adb460f5c Merge pull request #2936 from alphagov/broadcast-event-model
add broadcast_event table
2020-07-28 15:03:20 +01:00
Chris Hill-Scott
5b1b82030d Rename test files
To reflect new name of feature.
2020-07-28 12:56:48 +01:00
Chris Hill-Scott
b19451c7c6 Rename DAO file
To reflect new name of feature
2020-07-28 12:56:40 +01:00
Chris Hill-Scott
65346852ed Rename variables and functions in tests
To reflect the new name of the feature.
2020-07-28 12:56:32 +01:00
Chris Hill-Scott
716eb67bfd Re-label error messages
To reflect the new name of the feature.
2020-07-28 12:56:23 +01:00