Commit Graph
100 Commits
Author SHA1 Message Date
Pea Tyczynska 38af26cc78 Merge pull request #3199 from alphagov/admin-cancel-broadcast
Allow platform admins to cancel broadcasts.
2021-04-20 14:47:45 +01:00
Pea Tyczynska fce6a2d8dc Allow platform admins to cancel broadcasts.
Also update error message for when someone does not have permissions.

The message referenced approving broadcasts specifically, whereas
people would also see it if they try to cancel or reject
broadcast without permission.

Why we allow platform admins to cancel broadcasts:
we do this so they can react quickly if a broadcast was
approved by accident.
2021-04-20 12:27:38 +01:00
Pea Tyczynska 1a6ad92490 Merge pull request #3194 from alphagov/allow-double-hyphens-in-email-domains
Bump utils to allow double hyphens in email address domain
2021-03-30 11:06:08 +01:00
Pea Tyczynska a3aad24fe1 Bump utils to allow double hyphens in email address domain
It was requested by our user and it is an allowed domain format
with Amazon SES, so we started allowing it in our validation.
2021-03-29 17:53:29 +01:00
Pea Tyczynska 1903e8f268 Merge pull request #3168 from alphagov/client-reference
If client reference not given, try to get it from personalisation
2021-03-24 15:34:34 +00:00
Pea Tyczynska 52c529ab3a Use personalisation to set client_reference for letters
which were sent through Notify interface only. This is done
to avoid performance dip from additional operation for
other notification types.
2021-03-24 14:55:10 +00:00
Pea Tyczynska a2da8bc070 If client reference not given, try to get it from personalisation.
This is mostly useful for letters.

For templated letters sent via interface, whether one-offs
or CSV uploads, we do not give our users a way to set client reference.

Still, they often have a placeholder with reference that we could use
to set client_reference field.

Why is this helpful?

When letter is returned, or when we experience some printing issues,
often it is difficult to identify letters after the retention period.

This change will make it easier for some users to identify letters.
It will have more impact if we inform our users of this in template
editing guidance.
2021-03-24 14:55:10 +00:00
Pea Tyczynska 7c304f6753 Merge pull request #3163 from alphagov/billing-report
Update usage endpoint with billing details for orgs and services
2021-03-23 11:26:23 +00:00
Pea Tyczynska 0dbe4b27c8 Rearrange fixture for readability 2021-03-19 16:50:01 +00:00
Pea Tyczynska 04525dc8c1 Billing report only has services with bills to pay 2021-03-19 16:50:01 +00:00
Pea Tyczynska dd278a0567 Rename get_usage_for_all_services to get_data_for_billing_report
That describes what it does more correctly. As it does not include
services with no usage.
2021-03-19 16:50:01 +00:00
Pea Tyczynska 100d47f4e8 Refactor test and fixture for getting billing report data
Names of services and orgs were confusing, and variable setting
was done in a way that made it easy to introduce errors.

Now hopefully it is more readable and more error-proof.
2021-03-19 16:50:00 +00:00
Pea Tyczynska 4c3d70fd55 Update usage endpoint with billing details for orgs and services 2021-03-19 16:49:48 +00:00
Pea Tyczynska 516a982592 Merge pull request #3159 from alphagov/add-date-to-dvla-email-personalisation
Add date to personalisation for DVLA email
2021-02-24 14:54:06 +00:00
Pea Tyczynska f3e0cfc727 Pull DVLA address from credentials on staging
So that we can test this flow on staging.
2021-02-24 11:34:29 +00:00
Pea Tyczynska 8e3ef5ff05 Add DVLA_EMAIL_ADDRESS to manifest so it gets picked up from
credentials.
2021-02-24 10:32:20 +00:00
Pea Tyczynska 4fc3af9811 Add date to personalisation for DVLA email
Personalisation was missing date attribute. The email still got sent
tonight, just it didn't have a value for date placeholder.
2021-02-24 10:22:22 +00:00
Pea Tyczynska 8e5f956009 Merge pull request #3151 from alphagov/daily-volumes-dvla
Send daily email with volumes of letters and sheets to DVLA
2021-02-23 15:24:31 +00:00
Pea Tyczynska b05ddd4978 Don't donwgrade if the environment is production
Because we are nervous about deleting data on prod, since it can
block the db.
2021-02-23 15:13:53 +00:00
Pea Tyczynska 5c22c926b0 Stub DVLA email for all envs except prod
In prod we will get it from Credentials. In other envs, we don't
really want to send real email.
2021-02-23 15:13:52 +00:00
Pea Tyczynska e0c73ac342 Send daily email with letter and sheet volumes to DVLA 2021-02-23 15:13:19 +00:00
Pea Tyczynska 6dab63130d Make import order alphabetical 2021-02-23 15:13:19 +00:00
Pea Tyczynska c8ffebcce8 Query to get letter and sheet volumes
So we can send daily email with these volumes to DVLA.
2021-02-23 15:13:18 +00:00
Pea Tyczynska 88233543c3 Add email template for daily letter volumes 2021-02-23 15:13:18 +00:00
Pea Tyczynska df00e16100 Merge pull request #3127 from alphagov/stubbed-not-nullable
Make stubbed column on broadcast_message non-nullable
2021-02-10 14:02:17 +00:00
Pea Tyczynska 6e1c5a70c0 Make stubbed column on broadcast_message non-nullable
But first set any null values there to False.
2021-02-09 16:33:11 +00:00
Pea Tyczynska c2191d3a0e Merge pull request #3129 from alphagov/v2-set-stubbed
Set broadcast message to stubbed when posting broadcast via API
2021-02-09 15:37:01 +00:00
Pea Tyczynska 3037bf5fff Set broadcast message to stubbed when posting broadcast via API 2021-02-09 10:41:36 +00:00
Pea Tyczynska e0ddb5a39e Merge pull request #3126 from alphagov/fix-cryptography-build-problem
Pin cryptography to a version < 3.4
2021-02-08 17:25:44 +00:00
Pea Tyczynska 7cc8371c7f Pin cryptography to a version < 3.4
One of our dependencies has a dependency on cryptography, which has
recently released version 3.4.

This version introduced a circular import error
(pyca/cryptography#5756) which was fixed in
3.4.1.

However, 3.4.1 has a different error where it fails because it cannot
find a rust compiler.

The suggested
solutions are:

Install a newer version of pip which will install a pre-compiled
cryptography wheel OR
Have rust installed and available on our PATH so that it can be used
to build the package.
Since we can't change the buildpack's pip version and we cannot install
rust ourselves, the only we're left with is to avoid upgrading to 3.4 -
at least until PaaS updates their python buildpacks.
2021-02-08 17:05:46 +00:00
Pea Tyczynska f8b4c9151c Merge pull request #3122 from alphagov/add-billing-details-orgs
Add billing details for organisation
2021-02-08 16:43:08 +00:00
Pea Tyczynska bbc8cffb5b No need to alter the columns in services, they are already the right type 2021-02-08 10:45:28 +00:00
Pea Tyczynska aa7bc3d9b4 Serialise org notes and billing details 2021-02-05 14:44:43 +00:00
Pea Tyczynska 02bc87c096 Add billing details and notes for organisation table 2021-02-05 14:44:42 +00:00
Pea Tyczynska df4ba22912 Merge pull request #3114 from alphagov/preview-wont-stub
Don't stub broadcasts on preview
2021-01-29 16:00:11 +00:00
Pea Tyczynska 552e543bc2 Don't stub broadcasts on preview
So that MNOs can use training mode accounts to test end-to-end
broadcast sending. This will enable them to approve their own
broadcasts.
2021-01-29 15:49:50 +00:00
Pea Tyczynska 51c0ece130 Merge pull request #3108 from alphagov/stub-training-broadcasts
Stub training broadcasts
2021-01-28 11:58:47 +00:00
Pea Tyczynska d4cc250510 Don't create broadcast provider messages for stubbed broadcasts 2021-01-27 10:20:44 +00:00
Pea Tyczynska 26d6b4a958 Mark broadcast message as stubbed when sent from training account 2021-01-27 10:20:43 +00:00
Pea Tyczynska a93a35de8d Add 'stubbed' column to broadcast_message table
This is a boolean column. It will be set to True for broadcasts
created from training broadcast accounts.

This will help us debug, for example by excluding all the stubbed
broadcasts when we have some trouble with real broadcasts.
2021-01-27 10:20:43 +00:00
Pea Tyczynska dfbd31cef8 Merge pull request #3106 from alphagov/billing-fields-for-service
Add billing details fields to Service model and db table
2021-01-26 15:14:05 +00:00
Pea Tyczynska b3abdfb401 Rename billing contact email and name fields to plural
So:

'billing_contact_email_address' becomes 'billing_contact_email_addresses'
AND
'billing_contact_name' becomes 'billing_contact_names'

This is to signify that each of those fields can contain numerous
items
2021-01-25 17:53:27 +00:00
Pea Tyczynska ffac16a2a0 Add new billing details to test_get_service_by_id 2021-01-25 17:42:18 +00:00
Pea Tyczynska e703d1a172 Add billing details fields to Service model and db table
The fields are:
Purchase order number - string field
Billing contact name - text field to acommodate possible multiple
contacts
Billing contact email address - text field to acommodate possible
multiple contacts
Billing reference - string field

All these fields are nullable. Notify platform admins will be
able to check and edit those values in Service Settings
section in Notify interface.

This will help make billing tasks and reports simpler.

Similar fields will also be added to Organisation model and
db table.
2021-01-20 18:00:43 +00:00
Pea Tyczynska 882da84182 Merge pull request #3096 from alphagov/add-notes-to-service
Add notes column to services table
2021-01-19 14:45:42 +00:00
Pea M. Tyczynska 2749a707f2 Merge pull request #3067 from alphagov/fix-cancel-broadcast
Fix cancel broadcast by converting reference date to string
2020-12-21 13:56:19 +00:00
Pea M. Tyczynska 519568970c Merge pull request #3059 from alphagov/cancel_broadcast_cbc
Add cancel routes to cbc proxy clients
2020-12-18 12:09:49 +00:00
Pea M. Tyczynska bb41cabeb6 Merge pull request #3065 from alphagov/up-email-size-limit
Increase email size limit to 2MBby pulling in new utils
2020-12-16 16:14:58 +00:00
Pea M. Tyczynska a70b7c521e Merge pull request #3053 from alphagov/ibag-message-number
Add sequential message number to broadcast provider messages
2020-12-09 13:02:25 +00:00
Pea M. Tyczynska fefcb009d5 Merge pull request #3041 from alphagov/turn-on-sms-email-stubs-staging
Turn on SMS and email stubs on staging
2020-11-23 12:02:15 +00:00
Pea M. Tyczynska ffb19346e0 Merge pull request #3039 from alphagov/give-providers-equal-shares-of-traffic
Give sms providers equal shares of traffic
2020-11-19 10:48:56 +00:00
Pea M. Tyczynska b503267062 Merge pull request #2992 from alphagov/validate-email-size
Tailor message-too-long error message depending on the notification type
2020-10-30 11:07:29 +00:00
Pea M. Tyczynska c149f5020f Merge pull request #3004 from alphagov/divide-letters-by-service
Divide letters by service when putting in ZIP files
2020-10-21 15:31:26 +01:00
Pea M. Tyczynska 05160bc064 Merge pull request #2999 from alphagov/temporary-measure-letters
Temporarily do not send letters from Insolvency Service to DVLA
2020-10-16 16:24:34 +01:00
Pea M. Tyczynska 50982ff36a Merge pull request #2991 from alphagov/reset-password-email-gets-forward-link
Put redirect link in reset password email link
2020-10-12 12:26:42 +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 M. Tyczynska a2f911b253 Merge pull request #2924 from alphagov/add-contact-block-to-serialize-template
Add contact block to serialize template for v2
2020-07-23 15:42:17 +01:00
Pea M. Tyczynska fbdfa6416f Merge pull request #2921 from alphagov/remove-statsd-http-api-decorators
Remove statsd http api decorators and turn statsd back on for celery apps
2020-07-14 10:16:44 +01:00
Pea M. Tyczynska 5538c9697b Merge pull request #2905 from alphagov/dont-fail-check-migration
always run migrations if app is down
2020-07-08 11:49:32 +01:00
Pea M. Tyczynska 9186083ea7 Merge pull request #2796 from alphagov/split-letters-into-zips-based-on-postage
Split letters into zips based on postage
2020-07-08 11:49:21 +01:00
Pea M. Tyczynska 3954cd0e4a Merge pull request #2916 from alphagov/prevent-race-condition-sms-status
Do not update notification to sending if the status is already final
2020-07-06 13:16:36 +01:00
Pea M. Tyczynska 106185f418 Merge pull request #2913 from alphagov/turn-stubs-off-staging
Turn off the sms stub and email stub in staging
2020-07-03 10:33:29 +01:00
Pea M. Tyczynska 75a7e9b7fd Merge pull request #2892 from alphagov/refactor-crown-dependency-check
Refactor crown dependency check
2020-06-23 11:19:17 +01:00
Pea M. Tyczynska dcc407efea Merge pull request #2878 from alphagov/uk-prefix
Make sure people without international sms permission can send to crown dependencies
2020-06-19 16:58:48 +01:00
Pea M. Tyczynska 852d1ffa03 Merge pull request #2867 from alphagov/turn-off-email-stub
Turn off email stub on staging
2020-06-09 12:10:28 +01:00
Pea M. Tyczynska c63a78242c Merge pull request #2865 from alphagov/stub-email-and-sms-in-staging
Point API for staging at email and sms stubs for the soak tests.
2020-06-08 17:45:44 +01:00
Pea M. Tyczynska db040c40b9 Merge pull request #2860 from alphagov/put-status-codes-in-logs
Put status codes in logs
2020-06-02 16:06:05 +01:00
Pea M. Tyczynska 9f816ad5f5 Merge pull request #2856 from alphagov/mmg_detailed_response
Capture detailed delivery receipt status from MMG
2020-06-01 15:23:53 +01:00
Pea M. Tyczynska 2f8947afde Merge pull request #2832 from alphagov/move-pdf-creation-on-a-template-preview-task
Move pdf creation onto a template preview task
2020-05-11 16:18:58 +01:00
Pea M. Tyczynska 6724b2cd74 Merge pull request #2817 from alphagov/update_healthcheck_page
Update _status page - remove references to Travis
2020-04-24 14:09:44 +01:00
Pea M. Tyczynska d88b20beec Merge pull request #2813 from alphagov/firetext-check-code-on-failure-only
Check failure code on failure only.
2020-04-21 15:23:26 +01:00
Pea M. Tyczynska 750a573afc Merge pull request #2812 from alphagov/firetext-000-code
Take into consideration Firetext 000 code - no error.
2020-04-21 12:21:36 +01:00
Pea M. Tyczynska 850a56ab04 Merge pull request #2803 from alphagov/firetext-response-codes
Use firetext response code to see if temporary or permanent failure if available
2020-04-21 10:50:46 +01:00
Pea M. Tyczynska 69864611ef Merge pull request #2810 from alphagov/fix_preview
Fix bug where preview for templated letters would not show
2020-04-20 15:49:36 +01:00
Pea M. Tyczynska d15db5702c Merge pull request #2807 from alphagov/make-sure-letter-personalisation-is-string
Make sure letter personalisation is string - pull utils patch
2020-04-17 18:29:17 +01:00
Pea M. Tyczynska bf7a662b26 Merge pull request #2790 from alphagov/increase-startup-timeout
Increase startup timeout to 15 minutes
2020-04-01 15:27:17 +01:00
Pea M. Tyczynska 642eff9563 Merge pull request #2786 from alphagov/add-freezetime
Add missing freezetime to a test
2020-04-01 12:02:35 +01:00
Pea M. Tyczynska cff7f7b72d Merge pull request #2751 from alphagov/validate-and-format-postcode-api-flow
Validate and format postcode for the API letter sending flow.
2020-04-01 11:09:25 +01:00
Pea M. Tyczynska 401c8e41d6 Merge pull request #2779 from alphagov/change-error-code
Change error code for duplicate reply-to address to 409 meaning conflict
2020-03-31 14:48:56 +01:00
Pea M. Tyczynska d80fef8fe8 Update postcode validation error message 2020-03-19 14:40:26 +00:00
Pea M. Tyczynska 900664c172 Merge pull request #2748 from alphagov/format-postcode-for-csvs
Format postcode for CSV letter rows
2020-03-19 11:07:08 +00:00
Pea M. Tyczynska 40ef0d0913 Merge pull request #2729 from alphagov/validate_send_file_by_email_contact_deets
All services can send files by email if they have set contact_link
2020-02-27 15:48:08 +00:00
Pea M. Tyczynskaandkarlchillmaid 7ca35b44a7 Our new error message now has better grammar and form matching other errors more
Co-Authored-By: karlchillmaid <karl.chillmaid@digital.cabinet-office.gov.uk>
2020-02-26 13:38:48 +00:00
Pea M. Tyczynskaandkarlchillmaid 6d21515adf Apply suggestions from code review
Better grammar for our new error message.

Co-Authored-By: karlchillmaid <karl.chillmaid@digital.cabinet-office.gov.uk>
2020-02-26 10:45:39 +00:00
Pea M. Tyczynska 5cd27aee2c Merge pull request #2716 from alphagov/fix-reset-password
Fix reset password flow
2020-02-18 15:09:16 +00:00
Pea M. Tyczynska 9cd433349c Merge pull request #2706 from alphagov/change-when-we-validate-email-access
Validate email access based on code_type and not auth_type
2020-02-06 14:31:08 +00:00
Pea M. Tyczynska 0f6e8c330d Merge pull request #2705 from alphagov/populate-email-access-validated-at
Populate email_access_validated_at_column and make it non-nullable
2020-01-31 14:09:58 +00:00
Pea M. Tyczynska 8f31d6c7b4 Merge pull request #2704 from alphagov/fix_migration
Simplify the first migration, we will do execute statements later
2020-01-30 17:41:58 +00:00
Pea M. Tyczynska bf855c98fe Merge pull request #2703 from alphagov/fix_migration
Fix typo where wrong column name was checked for being null
2020-01-30 16:49:10 +00:00
Pea M. Tyczynska 1bbeee3441 Merge pull request #2702 from alphagov/fix_migration
Make sure email_access_validated_at is not null after being populated
2020-01-30 16:16:24 +00:00
Pea M. Tyczynska d34eafa1de Merge pull request #2700 from alphagov/re-validate-user-email
Add email_access_valdiated_at field to user table, populate it
2020-01-30 15:35:39 +00:00
Pea M. Tyczynska 8f9930792a Merge pull request #2678 from alphagov/convert-uuid-to-str
Use .format instead of concatenation to avoid type issues
2019-12-11 12:10:20 +00:00
Pea M. Tyczynska 2019070536 Merge pull request #2667 from alphagov/warn-team-about-high-failure-rates
Warn team about high failure rates
2019-12-09 11:28:25 +00:00
Pea M. Tyczynska 4f2a8352f2 Merge pull request #2657 from alphagov/validate-against-empty-messages
Validate against messages with no content
2019-11-26 11:41:02 +00:00
Pea (Malgorzata Tyczynska) 2b1a84dd0d Merge pull request #2647 from alphagov/tell-users-why-letter-failed-validation
Grab metadata when getting pdf letter preview from S3
2019-11-01 10:19:53 +00:00
Pea (Malgorzata Tyczynska) 35602b96fc Merge pull request #2631 from alphagov/add-validation-message-to-s3-as-metadata
Put pdf letter validation failed message in S3 metadata
2019-10-18 10:29:54 +01:00
Pea (Malgorzata Tyczynska) c1b53dce3a Merge pull request #2612 from alphagov/redaction_failed_doesnt_matter_when_test_key
Don't log address redaction failure when letter sent with test key
2019-09-18 16:05:39 +01:00
Pea (Malgorzata Tyczynska) 5cdce44e42 Merge pull request #2608 from alphagov/put_non_redacted_files_in_a_bucket
Copy original file to redaction_failure folder when redaction fails
2019-09-10 16:12:32 +01:00
Pea (Malgorzata Tyczynska) b5b72a83d6 Merge pull request #2604 from alphagov/new-response-from-template-preview
Handle both new and old response type from template preview's sanitise method
2019-09-09 14:58:05 +01:00
Pea (Malgorzata Tyczynska) 009406898f Merge pull request #2596 from alphagov/lighter-serialize-for-users
Leaner serialize for user model for displaying list of users
2019-08-20 11:40:07 +01:00