Commit Graph

11666 Commits

Author SHA1 Message Date
karlchillmaid
cd6574c28d Change 'broadcasting' to 'sending' 2021-07-05 17:42:37 +01:00
karlchillmaid
4b198fdf72 Change 'cancel' to 'reject' 2021-07-05 17:22:35 +01:00
karlchillmaid
d90d0d632e Change 'cancel' to 'reject' 2021-07-05 17:21:57 +01:00
karlchillmaid
18800a9cec Change 'withdraw' to 'discard' 2021-07-05 17:11:26 +01:00
karlchillmaid
2cc1ccfd7e Change 'withdraw' to 'discard' 2021-07-05 17:10:35 +01:00
karlchillmaid
2b8a495dc7 Update preview button content 2021-07-05 16:50:49 +01:00
karlchillmaid
d7e2b0b783 Replace 'broadcast' and 'prepared' 2021-07-05 16:41:17 +01:00
karlchillmaid
60d8734f79 Replace use of 'broadcast' 2021-07-05 16:39:48 +01:00
karlchillmaid
d804ab747e Replace use of 'broadcast' 2021-07-05 16:38:46 +01:00
karlchillmaid
f910c91a9d Remove use of 'broadcast' 2021-07-05 16:23:55 +01:00
karlchillmaid
64b0fb769b Remove use of 'broadcast' 2021-07-05 16:23:25 +01:00
karlchillmaid
5ffb2a8594 Remove use of 'broadcast' 2021-07-05 16:22:47 +01:00
karlchillmaid
4d2e769400 Replace use of 'broadcast' 2021-07-05 15:57:37 +01:00
karlchillmaid
72e83adb19 Replace use of 'broadcast' 2021-07-05 15:56:21 +01:00
karlchillmaid
a8bd65254e Change previous to past 2021-07-05 13:49:36 +01:00
karlchillmaid
ff576555cf Change previous to past 2021-07-05 13:47:10 +01:00
karlchillmaid
dcc38b5619 Change previous to past 2021-07-05 13:46:04 +01:00
Ben Thorner
256c840b46 Merge pull request #3948 from alphagov/send-upload-id
Send upload_id to Template Preview for logging
2021-07-01 12:22:13 +01:00
Ben Thorner
1f33924ceb Send upload_id to Template Preview for logging
This means we can include the anonymous ID for the file in the log
we have about Type3 fonts [1]. Currently, we have no way of tracing
manually uploaded files with this potential defect.

[1]: https://github.com/alphagov/notifications-template-preview/pull/557
2021-07-01 12:09:47 +01:00
Chris Hill-Scott
bcc494f0ec Merge pull request #3943 from alphagov/fix-invalid-geometries
Fix invalid polygons while importing geographic data
2021-06-30 16:19:29 +01:00
Ben Thorner
aad017a184 Merge pull request #3927 from alphagov/webauthn
Webauthn bug fixes and permission tightening
2021-06-30 14:12:11 +01:00
Leo Hemsted
71613dd942 remove old /two-factor endpoint and update test names
we redirect people to `/two-factor-sms` since #26ad20719
2021-06-29 16:19:24 +01:00
Leo Hemsted
c439cafd37 always create platform admin users with webauthn in tests 2021-06-29 16:19:22 +01:00
Leo Hemsted
126f9cf6be fix bug stopping editing of permissions of webauthn platform admins
We hide the radio field in the HTML for platform admins, as we don't
want anyone to be able to change their auth type. However, when the form
is validated, the form has a field called login_authentication that it
expects a value for. It silently fails as it complains that when the
user POSTed they didn't select a value for that radio field, but the
error message is on the radio fields that don't get displayed to the
user so they'd never know.

Fixing this is actually pretty hard.

We use this form in two places, one where we have a user to edit, one
where we are creating an invite from scratch. So sometimes we don't know
about a user's auth type. In addition, radio buttons are mandatory by
design, but now sometimes we don't just want to make it optional but
explicitly ignore the value being passed in? To solve this, remove the
field entirely from the form if the user is a platform admin. This means
that if the code in manage_users.py tries to access the
login_authentication value from the form, it'll error, but I think
that's okay to leave for now given we concede that this isn't a perfect
final solution.

The tests didn't flag this previously as they tried to set from sms_auth
(the default for `platform_admin_user`) TO email_auth or sms_auth. Also,
the diagnosis of this bug was confounded further by the fact that
`mock_get_users_by_service` sets what is returned by the API - the
service model then takes the IDs out of that response and calls
`User.get_user_by_id` for the matching ID (as in, the code only uses
get_users_by_service to ensure the user belongs to that service). This
means that we accidentally set the form editing the current user, as
when we log in we set `get_user_by_id` to return the user of our choice
2021-06-29 15:53:48 +01:00
Leo Hemsted
92b6885224 ensure webauthn page aborts if user isn't allowed 2021-06-29 15:53:48 +01:00
Rebecca Law
5534ecb5a4 Merge pull request #3939 from alphagov/check-daily-limit-for-csv-uploads
Check the daily limit get the daily notification_count from redis.
2021-06-29 14:41:22 +01:00
Ben Thorner
307f3a3b9a Merge pull request #3946 from alphagov/refactor-user-fixtures
DRY up user fixtures and factories
2021-06-29 09:58:10 +01:00
Rebecca Law
77c2aa9fd6 Stop passing in today_only for the get_service_statistics method.
We now only ever call it with False.
To remove it from the api call will require a change in the API so will do that at another time.
2021-06-29 07:33:40 +01:00
Ben Thorner
1806ff2721 DRY up fixtures to use their equivalent factory
It's unclear if we really need the factory functions, but for now
this avoids the fixture and the factory diverging.
2021-06-28 17:52:11 +01:00
Ben Thorner
91b28879f7 DRY up fixtures for service one users / admins
Note that, while it makes sense for most service one users to also
be in the organisation, this doesn't apply to caseworkers.
2021-06-28 17:45:19 +01:00
Ben Thorner
81cdc31e80 Refactor creating user fixture into one function
This removes *a lot* of duplication, in advance of adding another
fixture for a user with a WebAuthn auth type.
2021-06-28 17:25:36 +01:00
Chris Hill-Scott
b47d04fbf6 Check that the simplification process hasn’t introduced bad data
This is a good bit of future proofing against unintended mistakes in the
simplification code.
2021-06-24 18:28:33 +01:00
Chris Hill-Scott
72cdad14d9 Run app/broadcast_areas/create-broadcast-areas-db.py 2021-06-24 18:28:33 +01:00
Chris Hill-Scott
779ac74fc7 Manually remove a coordinate from Bathavon South
This is the only way I can think to stop this shape self-intersecting
without drastically changing its area (i.e. filling the hole in the
donut).

This is the only area in our library which is a genuine donut and
presents this problem
2021-06-24 18:28:21 +01:00
Chris Hill-Scott
62a2c524ab Fix invalid polygons while importing geographic data
Some of the polygons in our source data are invalid. An invalid polygon
is one that self intersects, in other words has a point which causes
the boundary of the shape to cross itself.

This doesn’t cause an exception until we try to perform certain
operations on one of these polygons, like intersecting them with another
polygon. This is why we haven’t spotted that they are invalid until now.

This commit adds checks so that as we import the polygons we make sure
they are valid.

If they are not valid, we can automatically fix them by just looking at
the exterior boundary of the shape, and ignore any holes created by
self intersection.
2021-06-24 18:10:50 +01:00
Ben Thorner
e7c1ce1869 Merge pull request #3938 from alphagov/save-original-pdf-uploads
Backup original precompiled uploads to S3
2021-06-24 12:43:40 +01:00
Ben Thorner
b3f48c1a84 Backup original precompiled uploads to S3
This continues the work from Template Preview [1], so that we have
a complete store of original PDFs to use for testing changes to it.

Previously we did store some originals, but these were only invalid
PDFs that had failed sanitisation; for valid PDFs, the "transient"
bucket only contains the sanitised versions, which the API deletes
/ moves when the notification is sent [2].

Since the notification is only created at a later stage [3], there's
no easy way to get the final name of the PDF we send to DVLA. Instead,
we use the "upload_id", which eventually becomes the notification ID
[4]. This should be enough to trace the file for specific debugging.

Note that we only want to store original PDFs if they're valid (and
virus free!), since there's no point testing changes with bad data.

[1]: https://github.com/alphagov/notifications-template-preview/pull/545
[2]: c44ec57c17/app/service/send_notification.py (L212)
[3]: 7930a53a58/app/main/views/uploads.py (L362)
[4]: 7930a53a58/app/main/views/uploads.py (L373)
2021-06-24 12:21:05 +01:00
Katie Smith
a6e0f30163 Merge pull request #3940 from alphagov/fix-report
Update data format for platform admin report
2021-06-24 09:11:57 +01:00
Katie Smith
1862cd0223 Update data format for platform admin report
The format of dates returned from API for the "Monthly notification
statuses for live services" report has changed, so we no longer need to
format the dates here.

https://github.com/alphagov/notifications-api/pull/3279
2021-06-23 16:14:58 +01:00
Rebecca Law
44f02f2e30 To check the daily limit get the daily notification_count from redis.
The daily limit cache is set by the api when a notification is created. There is one cache key per service per day and it expires after 24 hours.
2021-06-23 15:56:05 +01:00
Pea Tyczynska
7930a53a58 Merge pull request #3935 from alphagov/more-detailed-request-go-live-ticket
Make a label more descriptive in request-to-go-live ticket
2021-06-18 10:01:50 +01:00
Pea Tyczynska
d1dc1aec6c Make a label more descriptive in request-to-go-live ticket
We have a label saying "other live services". This label means
other live services for a user making the request, but it could
also be interpreted as other live services for an organisation.

Hence, we are changing the label to "other live services for
that user" to avoid confusion
2021-06-17 17:53:28 +01:00
Ben Thorner
562245d9cd Merge pull request #3931 from alphagov/refactor-email-verify-webauthn
Refactor email revalidation check
2021-06-16 16:24:41 +01:00
Ben Thorner
9177ffa65a Clarify variable name in pagination tests
We should avoid using abbreviations, as they aren't universally
understood i.e. they're not worth the small saving in typing.
2021-06-16 16:08:38 +01:00
karlchillmaid
4f72982995 Merge pull request #3934 from alphagov/add-send-file-info-to-security-page
Add a line about retention for files sent by email
2021-06-16 14:40:45 +01:00
Ben Thorner
ca9c28d08f Merge pull request #3897 from alphagov/remove-run-tests
Run tests directly from the Makefile
2021-06-16 14:02:44 +01:00
karlchillmaid
3d158319ee add link state
Co-authored-by: David McDonald <david.mcdonald@digital.cabinet-office.gov.uk>
2021-06-16 13:59:06 +01:00
karlchillmaid
420c5f8365 Update content to make things clearer 2021-06-16 13:22:39 +01:00
karlchillmaid
cd04ca980d Add a line about retention for files sent by email 2021-06-16 11:28:14 +01:00
Ben Thorner
3f889118a7 Merge pull request #3933 from alphagov/login-no-webauthn
Show an error if user cannot login with WebAuthn
2021-06-15 15:12:11 +01:00