David McDonald
5b2dee5ddb
Bump utils to 42.0.0
...
Requires unit test updating as we now expect broadcast event areas to
be a dict containing a list of areas and simple polygons.
2020-09-14 15:21:55 +01:00
David McDonald
d352c99142
Remove unused send_broadcast_message task
...
We only call send_broadcast_event now
2020-09-14 15:16:59 +01:00
David McDonald
5aee6269e0
Fix format of simple_polygons
...
It is not of the form
[[lat, long][lat, long]] as this would only hold a single polygon. It
instead needs to handle multiple polygons so instead is of the form
[[[lat, long][lat, long]]].
2020-09-14 14:55:01 +01:00
David McDonald
288e3ae811
Bring in latest version of utils to fix link breaking bug
...
Fixes https://github.com/alphagov/notifications-utils/pull/784
Note, also is a breaking change of the utils, see
https://github.com/alphagov/notifications-utils/pull/769
but I don't believe it requires any changes on the API because of this
2020-09-10 14:32:02 +01:00
Rebecca Law
8d4228dd55
Merge pull request #2963 from alphagov/catch-exception-for-event
...
Catch and log any exception thrown in the checkin event method.
2020-09-10 13:16:08 +01:00
Rebecca Law
da4efbbb82
Catch and log any exception thrown in the checkin event method.
...
We don't want an exception while recording metrics to affect a user action. A KeyError exception was thrown today, that meant that a user say a 500, the action being performed was to download a document from the document-download-frontend app. By catching the error we prevent the user from seeing a 500 when a recording the connection metric fails.
Also catch the exception in the checkout event.
2020-09-10 12:25:35 +01:00
Chris Hill-Scott
92af5b8d67
Merge pull request #2968 from alphagov/cancel-international-letters
...
Allow international letters to be cancelled
2020-09-09 14:10:23 +01:00
Chris Hill-Scott
0e1f6f31e4
Use constant for notification type
...
Co-authored-by: Katie Smith <klssmith@users.noreply.github.com >
2020-09-09 11:12:06 +01:00
Chris Hill-Scott
cfda289746
Allow international letters to be cancelled
...
Our code was assuming that any notifications with `international` set to
`True` were text messages. It was then trying to look up delivery
information for a notification which wasn’t sent to a phone number,
causing an exception.
2020-09-09 10:55:55 +01:00
Rebecca Law
ea36a3804e
Merge pull request #2967 from alphagov/fix-update-organisations
...
Fix update organisations
2020-09-09 10:55:33 +01:00
Rebecca Law
795a035fac
When the organisation updates the crown attribute it should update all the services associated with that organisation too.
2020-09-09 10:43:16 +01:00
Pea M. Tyczynska
a9168d38a7
Merge pull request #2965 from alphagov/send-polygons-to-api
...
Persist simple polygons in the db.
2020-09-08 12:08:53 +01:00
Pea Tyczynska
b86ce6844f
Ensure data model the same at creation as when updating broadcast message
2020-09-08 11:04:13 +01:00
David McDonald
bd9ce53ba1
Merge pull request #2966 from alphagov/provider-split
...
Converting resting provider split to 60/40
2020-09-08 10:35:53 +01:00
Pete Herlihy
7db4a882ce
Converting resting provider split to 60/40
2020-09-08 10:17:27 +01:00
Pea Tyczynska
b3ff172780
Validate that both polygons and areas have to be updated
...
Because areas and polygons for broadcast messages should
be in sync.
2020-09-07 15:54:31 +01:00
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