Commit Graph

6677 Commits

Author SHA1 Message Date
Katie Smith
3b670a0dbe Delete unused delivery blueprint 2019-08-12 10:54:11 +01:00
Katie Smith
51716fbaf8 Change email status to permanent-failure if SES raises InvalidParameterValue
If SES raised an `InvalidParameterValue` error (because an email address
was wrong) we were logging an exception and setting the email status to
`technical-failure`. We now set it to `permanent-failure` instead and
change the log level to `info` - setting it to `permanent-failure` means
that people will know not to retry the message.
2019-08-12 10:24:59 +01:00
Katie Smith
6ab6f09b7b Merge pull request #2579 from alphagov/fix-migration-name
Rename migration file to match migration revision ID
2019-08-09 13:59:15 +01:00
Katie Smith
b31e431d4e Rename migration file to match migration revision ID
Because these were slightly different, the `check_if_new_migration`
script would always think there was a new migration to run and so we
were always testing the db migrations when deploying.
2019-08-09 12:41:19 +01:00
Katie Smith
a02bca141d Merge pull request #2577 from alphagov/fast-sms-retry
Retry deliver_sms task immediately if sending fails
2019-08-09 11:44:32 +01:00
Katie Smith
e449e234db Retry deliver_sms task immediately if sending fails
If the `deliver_sms` catches an exception when trying to send an SMS, we
want the first retry to happen immediately (because we will have
switched providers), then every retry after that to happen at the
standard intervals.
2019-08-08 09:34:38 +01:00
Rebecca Law
eda0640869 Merge pull request #2578 from alphagov/use-scheduled-for-date
Use scheduled_for datetime for purging CSV files
2019-08-08 09:33:39 +01:00
Rebecca Law
16fd12be6a If a job was created 7 days ago but scheduled to send 2 days later, the csv file will be deleted from S3 two days early.
For example if a file is uploaded on Aug 1, but scheduled for Aug 3, the csv file will be deleted 2 days before the notifications.
This will cause an error for on the jobs pages if the download report link is clicked.
2019-08-07 16:54:04 +01:00
Katie Smith
328832f21f Merge pull request #2574 from alphagov/upload-letters-permission
Add new 'upload_letters' permission
2019-08-05 15:06:49 +01:00
Katie Smith
f8035811a7 Add new 'upload_letters' permission 2019-08-05 12:02:43 +01:00
Andy Paine
daa437e42c Merge pull request #2573 from alphagov/use-paas-statsd-exporter
REP-340: Use PaaS statsd exporter
2019-08-05 11:22:35 +01:00
Andy Paine
088f234185 REP-340: Use PaaS statsd exporter
- We are running the statsd-exporter on the PaaS now so we can use the
  internal UDP route to talk to it
- Only update in preview and staging still so that we can get the
  dashboards fully up to date before switching prod
2019-08-05 10:36:58 +01:00
Leo Hemsted
4056e335cc Merge pull request #2572 from alphagov/utils-bump
bump utils
2019-08-02 13:04:57 +01:00
Leo Hemsted
9726edf68d bump utils
also remove the `read().splitlines()` pattern from csv.reader usage,
as it's redundant. also add .vscode to gitignore to accomodate my
hipster IDE choices, and add some lines to pytest.ini so just running
`py.test` uses some useful flags
2019-08-02 12:41:03 +01:00
Leo Hemsted
832ca8775f Merge pull request #2569 from alphagov/lower-dvla-zip-size
Lower the max dvla zip size from 500mb to 40mb
2019-07-31 16:14:26 +01:00
Rebecca Law
2b0ef807d6 Merge pull request #2568 from alphagov/add-nhs-trust-org
Add email and letter branding to the add organisation command
2019-07-30 14:49:22 +01:00
Rebecca Law
b39da01573 Remove white space from email branding column. 2019-07-30 14:34:23 +01:00
Leo Hemsted
2b06e810c5 Lower the max dvla zip size from 500mb to 40mb
There's a bug in pysftp that appears to cause quadratic performance loss. See https://github.com/paramiko/paramiko/issues/1141 for more details.

As a temporary band-aid fix, lower the size of the files we're sending.
2019-07-29 17:23:22 +01:00
Leo Hemsted
de42b1004d Merge pull request #2567 from alphagov/handle-405s
handle 405s
2019-07-29 16:28:27 +01:00
Rebecca Law
467d9780c1 Add email and letter branding to the add organisation command (by csv file) 2019-07-29 15:35:54 +01:00
Leo Hemsted
2c2eb2abad handle 405s
Handle werkzeug http errors separately. Also, improve the generic
`Exception` handler to be more flexible when exceptions don't look
like http errors.

note: because they're 405s the route isn't matched, so the v2 error
handlers don't trip properly. this might be an issue because the
internal endpoints expect a different return format. Might have to
think about how to handle this.
2019-07-26 13:26:20 +01:00
Pea (Malgorzata Tyczynska)
359016de6a Merge pull request #2565 from alphagov/migrate_org_types
Migrate org types
2019-07-26 10:51:42 +01:00
Pea Tyczynska
5977adef1c Add live to excluded environments in migration 2019-07-25 16:03:08 +01:00
Pea Tyczynska
38bb2c1cf6 Simpify org types migration script and introduce foreign key
Don't transform org types on prod
2019-07-24 17:55:56 +01:00
Katie Smith
d8d85db7c3 Merge pull request #2564 from alphagov/engagement-team-report
Add endpoint with data for report for the engagement team
2019-07-23 10:13:14 +01:00
Katie Smith
b4a6aecbb9 Add endpoint to return monthly notification stats per service
This will be used by notifications-admin to create a CSV report.
2019-07-23 10:00:50 +01:00
Katie Smith
81de71dc1f Add dao function that gets the required data 2019-07-23 10:00:50 +01:00
Pea Tyczynska
5b256fa64e Migrate all orgs and services onto new organisation types
Remove all mentions of generic 'nhs' organisation type.
2019-07-22 14:58:41 +01:00
Pea (Malgorzata Tyczynska)
da61bb3b06 Merge pull request #2557 from alphagov/more_org_types
Introduce new organisation types and organisation_types db table
2019-07-22 14:55:30 +01:00
Pea (Malgorzata Tyczynska)
c0966ad90d Merge pull request #2563 from alphagov/change_content_cancel_letter_job
Change content of error messages when letter job can't be cancelled.
2019-07-22 13:28:11 +01:00
Chris Hill-Scott
01c4ec3e68 Merge pull request #2554 from alphagov/dissociate-default-template-replies
Dissociate letter contact blocks before archiving
2019-07-22 11:55:29 +01:00
Pea (Malgorzata Tyczynska)
957cf46748 Change apostrophes to prettier ones
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-07-22 10:48:34 +01:00
Chris Hill-Scott
da1219fadf Let services have no default letter contact blocks
If they delete the default we’ll treat ‘Blank’ as the default on the
frontend.
2019-07-22 10:40:18 +01:00
Chris Hill-Scott
dd225fbc6e Dissociate letter contact blocks before archiving
Otherwise you can’t archive it.
2019-07-19 15:40:28 +01:00
Pea Tyczynska
edda816ffa Temporarily add generic 'nhs' 2019-07-19 15:13:24 +01:00
Pea Tyczynska
aa88252cf7 Drop making crown not nullable on downgrade as it would fail anyway 2019-07-18 17:05:24 +01:00
Pea Tyczynska
610bf5d149 For now include nhs type orgs in allowed organisation types 2019-07-18 17:05:24 +01:00
Pea Tyczynska
d89ef0594f nhs_central is crown org and also we do not update org type while
updating service anymore.
2019-07-18 17:05:24 +01:00
Pea Tyczynska
e4cb56b5d3 Emergency service instead of emergency services 2019-07-18 17:05:23 +01:00
Pea Tyczynska
8a3ac8400f Update service type and crown when service is added to organisation 2019-07-18 17:05:23 +01:00
Pea Tyczynska
9dfc550f46 Add org types table 2019-07-18 17:05:22 +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
Pea Tyczynska
e9de84beb0 Change content of error messages when letter job can't be cancelled.
This content was first done without help of content designer so
now it is improved with the help of one. New content is more
in line with the content in the admin app and more human-readable
and following GOV.UK standard.
2019-07-18 16:38:08 +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