Commit Graph

7699 Commits

Author SHA1 Message Date
Pea Tyczynska
5927aae019 Serialise simple_polygons attribute of BroadcastMessage 2020-09-07 15:54:31 +01:00
Pea Tyczynska
2f6b96dafc Ensure broadcast with no areas cannot be approved
This is already checked by admin app, but we want to have a
fallback safety measure as a precaution.
2020-09-07 15:54:30 +01:00
Pea Tyczynska
bceb5d8fde Purge broadcast data
To avoid problems after changing data type for areas column from
array to dictionary.
2020-09-07 15:54:30 +01:00
Pea Tyczynska
5cf6e1cf72 Persist simple polygons in the db.
They are being sent over from admin, and persisted
in the db so we can send them on to the broadcast
provider later on.
2020-09-07 15:52:14 +01:00
David McDonald
06ff8723d2 Merge pull request #2964 from alphagov/pyup-scheduled-update-2020-09-02
Scheduled weekly dependency update for week 35
2020-09-07 14:33:57 +01:00
David McDonald
86565fcee9 make freeze 2020-09-07 14:24:13 +01:00
Rebecca Law
5e88df5384 Merge pull request #2951 from alphagov/international-letters-for-all-part2
Add international letter service permissions for all services
2020-09-07 08:34:22 +01:00
Rebecca Law
93475912ba Merge pull request #2950 from alphagov/international-letters-for-all
Default international_letters for service permissions.
2020-09-07 07:39:52 +01:00
pyup-bot
87599dce4a Update sqlalchemy from 1.3.18 to 1.3.19 2020-09-02 14:00:06 +01:00
pyup-bot
c5688dde2b Update eventlet from 0.26.1 to 0.27.0 2020-09-02 14:00:05 +01:00
pyup-bot
e7e1e9d478 Update flask-marshmallow from 0.11.0 to 0.13.0 2020-09-02 14:00:04 +01:00
pyup-bot
90045646d3 Update cffi from 1.14.1 to 1.14.2 2020-09-02 14:00:03 +01:00
Katie Smith
cf20588603 Merge pull request #2960 from alphagov/int-ft-billing
Set 'international' for letters in ft_billing
2020-08-25 10:27:51 +01:00
Katie Smith
b30701d7e1 Set 'international' for letters in ft_billing
`international` for letters in `ft_billing` was always False. Now that
letters can be international, this changes the column value to the value
of `international` for the notification.
2020-08-21 09:19:27 +01:00
Katie Smith
6439200c71 Merge pull request #2958 from alphagov/invited-user-endpoints
Add endpoints to get invited users
2020-08-19 09:00:51 +01:00
Katie Smith
8dcc65d11c Add endpoints to get invited users
We want to display flash messages in admin when invites have been
cancelled. This message needs to display the user's email address, so
this commit adds endpoints to GET a single invited service user and org
user so that we can look up the email address of a cancelled user.
2020-08-19 08:49:33 +01:00
David McDonald
4ff0f5c4de Merge pull request #2953 from alphagov/pyup-scheduled-update-2020-08-12
Scheduled weekly dependency update for week 32
2020-08-18 12:16:07 +01:00
David McDonald
1b36a75927 Dont upgrade flask marshmallow as breaks things 2020-08-18 12:04:48 +01:00
David McDonald
bc5a5cf1ab make freeze requirements 2020-08-18 10:00:58 +01:00
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