Commit Graph

6486 Commits

Author SHA1 Message Date
Chris Hill-Scott
dd225fbc6e Dissociate letter contact blocks before archiving
Otherwise you can’t archive it.
2019-07-19 15:40:28 +01:00
Rebecca Law
ed6f9e4736 Merge pull request #2562 from alphagov/fix-reporting-tables
Bug fix for report tasks (stat tables)
2019-07-18 17:05:16 +01:00
Rebecca Law
996dcdd88c Increase the number of days we rebuild the tables for 2019-07-18 16:45:27 +01:00
Rebecca Law
a52c65ea29 Remove the delete query when updating the ft_billing. It's in the wrong place and we also should not need it. 2019-07-18 16:24:06 +01:00
Katie Smith
5ce3f2661c Merge pull request #2561 from alphagov/bump-utils
Bump utils to 33.2.4
2019-07-18 15:38:41 +01:00
Rebecca Law
ed611f982c We found a problem with the report tasks that populate the fact tables (or statistic tables). It is possible that the notification status can change for notifications after 4 days.
This PR updates those queries to look in either Notification or NotificationHistory. Since the data does not exist in both tables at the same time we can do with and not worry about the data retention.
The query will iterate over each service, then each notification type and query the data if no results then try the history table.
2019-07-18 15:29:54 +01:00
Katie Smith
3a9bc36b54 Bump utils to 33.2.4 2019-07-18 15:27:13 +01:00
Katie Smith
68f19b847c Merge pull request #2560 from alphagov/bump-utils
Bump utils to 33.2.3
2019-07-18 14:43:04 +01:00
Katie Smith
db95a8460b Bump utils to 33.2.3 2019-07-18 14:11:41 +01:00
Katie Smith
663ab6d96b Merge pull request #2553 from alphagov/automtically-set-service-org-type
Set org_type of a service when adding/updating org org type
2019-07-16 10:22:06 +01:00
Chris Hill-Scott
46fa576a2c Merge pull request #2558 from alphagov/bump-utils-33.2.2
Bump utils to 33.2.2
2019-07-15 15:24:38 +01:00
Chris Hill-Scott
a87a8f3fc6 Bump utils to 33.2.2
Changes:
- https://github.com/alphagov/notifications-utils/compare/33.2.1...33.2.2
2019-07-15 15:16:38 +01:00
Katie Smith
cec87a9de0 Delete unused code
* The `_should_record_notification_in_history_table` function stopped being
used in this commit: c23ae15f32
* `NOTIFICATIONS_ALERT` stopped being used in this commit: 5aa37f09b6
2019-07-12 16:43:37 +01:00
Katie Smith
1671221642 Set org_type of a service when adding/updating org org type
The organisation_type of a service should match the organisation_type of
the service's organisation (if there is one). This changes
dao_update_organisation and dao_add_service_to_organisation to set the
organisation_type of any services when adding / updating an org.
2019-07-12 16:43:37 +01:00
Leo Hemsted
86f14563d0 Merge pull request #2548 from alphagov/mou-recipts
tell people when they've signed an MOU
2019-07-12 16:00:50 +01:00
Leo Hemsted
a0c0dec429 add tests
include dynamically loading the template contents from the alembic upgrade file itself
2019-07-12 15:14:13 +01:00
Leo Hemsted
8e32995c8d only send emails if a user signed the MOU
the agreement_signed field can also be edited by a platform admin - if
that happened we might not have details for who signed it, and even if
we did they shouldn't find out about, and we don't need an email since
we were the ones who clicked the button.

the `agreement_signed_by` field is only set when a user confirms that
they are signing the MOU on the admin page - not if a platform admin
modifies the page from the platform admin page
2019-07-12 15:08:55 +01:00
Leo Hemsted
07bb0f0332 send emails when MOU is signed
we build up one personalisation dict, and then pass it in to all the
different templates - so be careful editing things. also of note, we
check if the agreement_signed_on_behalf_of is set, and send a different
template with slightly different wording to the person who clicked the
confirm button.
2019-07-12 15:08:55 +01:00
Chris Hill-Scott
3e11d2492a Merge pull request #2552 from alphagov/create-update-org-extra-fields
Add extra fields to create/update organisation
2019-07-12 15:03:56 +01:00
Chris Hill-Scott
df0361b6d9 Merge pull request #2556 from alphagov/bump-utils-br-spacing
Bump utils to bring in changes to email HTML
2019-07-10 11:02:34 +01:00
Chris Hill-Scott
4a2e906dfb Merge pull request #2540 from alphagov/remove-old-fields-from-organisations-and-services
Remove old fields from organisations and services
2019-07-10 11:02:26 +01:00
Chris Hill-Scott
a2e1c812b2 Bump utils to bring in changes to email HTML
Changes:
https://github.com/alphagov/notifications-utils/compare/33.1.0...33.2.1
2019-07-10 10:17:19 +01:00
Leo Hemsted
65a9df0196 Merge pull request #2555 from alphagov/mou-templates
add emails to send when an MOU is signed
2019-07-09 16:05:28 +01:00
Leo Hemsted
a61a28a8c8 add emails to send when an MOU is signed
* tell the user that clicks the button
* tell the notify team
* tell the person that the button was clicked on behalf of

there are two templates for the first case
2019-07-09 11:57:13 +01:00
Pea (Malgorzata Tyczynska)
e3fdfff29b Merge pull request #2543 from alphagov/cancel-letter-job
Cancel letter job
2019-07-04 14:25:17 +01:00
Pea Tyczynska
8588d00657 Move tests closer to the code:
test can_letter_job_be_cancelled closer to the code
test dao_cancel_letter_job closer to the code
Mock out calls in cancel_letter_job to test just that method
2019-07-04 14:12:11 +01:00
Chris Hill-Scott
a4ae534f87 Add extra fields to create/update organisation 2019-07-03 16:46:01 +01:00
Pea Tyczynska
2c79801c96 Return tuple from can_cancel_letter_job for clarity 2019-07-02 18:12:48 +01:00
Katie Smith
1ebd147ad0 Merge pull request #2551 from alphagov/fix-0-billable-units
Fix 0 billable units on provider callback
2019-07-02 09:12:55 +01:00
Pea Tyczynska
090769a069 Pull cancellable job statuses from utils and fix tests 2019-07-01 15:45:03 +01:00
Pea Tyczynska
da65ba0c91 Return specific error messages if job cannot be cancelled
Also move checking if job can be cancelled to the endpoint
2019-07-01 15:44:39 +01:00
Pea Tyczynska
cc966b1cf0 More checks and tests for cancelling a letter job 2019-06-28 15:57:39 +01:00
Rebecca Law
663b260777 Adding a cancel-letter-job endpoint to cancel a letter job. 2019-06-28 15:57:39 +01:00
Rebecca Law
6565c19a9b Adding new method to cancel a letter job. 2019-06-28 15:57:39 +01:00
Pea (Malgorzata Tyczynska)
5093b68f94 Merge pull request #2537 from alphagov/template_redacted_add_rows
Add rows in template_redacted where they are missing and help remember to insert them in the future
2019-06-28 14:41:51 +01:00
Rebecca Law
b45db5cab3 Merge pull request #2538 from alphagov/fix-team-recipient-check
Update to unit tests
2019-06-28 14:40:16 +01:00
Katie Smith
4f7cde3452 Fix 0 billable units on provider callback
We occasionally get an SMS with 0 `billable_units` if the `delivery-sender-worker`
is stopped in the middle of processing a notification - we have to fix
these manually. This change checks the billable units when we get the response from
our SMS provider and sets the correct billable units if it's 0.
2019-06-28 12:19:21 +01:00
Pea Tyczynska
2a5b0f8f17 Change the order of delete statements to respect foreign key constraint 2019-06-28 11:22:12 +01:00
Pea (Malgorzata Tyczynska)
d2b3b9940f Merge pull request #2550 from alphagov/degrade_alert_to_warning
Degrade MaxRetriesExceededError to warning status in logger
2019-06-27 15:46:51 +01:00
Pea Tyczynska
e033f3300b Degrade MaxRetriesExceededError to warning status in logger
This is because that error is caused by our providers and we
cannot do anything about it but it can make our logs hard to read
and actionable errors harder to spot
2019-06-27 14:55:10 +01:00
Pea Tyczynska
9782b08982 Add comment reminder to add template redacted when creating a template
through a migration.
Also fix the downgrades so they delete everything that needs deleting.
2019-06-26 19:03:15 +01:00
Pea Tyczynska
bd3594b2a9 Resign from trigger solution as we couldn't make it work 2019-06-26 18:36:03 +01:00
Pea Tyczynska
32e45828f8 Rename migration file 2019-06-26 18:36:03 +01:00
Pea Tyczynska
ce6f1a5572 Add trigger that ensures row in template_redacted is created
when adding new template through a migration
2019-06-26 18:36:03 +01:00
Pea Tyczynska
0ca7d4a20c Create template_redacted entry for templates created by migration
So that we can edit those templates
2019-06-26 18:36:03 +01:00
Pea (Malgorzata Tyczynska)
b5abe788e4 Merge pull request #2549 from alphagov/revert-2536-ensure_no_errors_when_creating_template
Revert "Ensure dao_create_template doesn't clash with new trigger"
2019-06-26 18:34:48 +01:00
Pea (Malgorzata Tyczynska)
ccfa1c8228 Revert "Ensure dao_create_template doesn't clash with new trigger" 2019-06-26 18:01:20 +01:00
Katie Smith
38fb7af2be Merge pull request #2546 from alphagov/bump-utils
Bump utils to add alt text to email branding
2019-06-26 09:35:44 +01:00
Katie Smith
284785a7d7 Bump utils to add alt text to email branding
Utils 33.0.0 adds alt text to email branding - the HTMLEmailTemplate now
initializes slightly differently as a result (with both `branding_name`
and `branding_text`).
2019-06-25 16:53:07 +01:00
Pea (Malgorzata Tyczynska)
e4c90c4bb9 Merge pull request #2536 from alphagov/ensure_no_errors_when_creating_template
Ensure dao_create_template doesn't clash with new trigger
2019-06-25 16:19:48 +01:00