Commit Graph

5536 Commits

Author SHA1 Message Date
Chris Hill-Scott
39b01f145f Merge pull request #2090 from alphagov/glamorgan-rother-wealden
Add two new letter logos
2018-09-14 15:22:52 +01:00
Chris Hill-Scott
244e91021d Add two new letter logos 2018-09-14 13:58:50 +01:00
Alexey Bezhan
6ff9f81934 Merge pull request #2089 from alphagov/notification-history-onupdate
Change NotificationHistory.updated_at on update
2018-09-13 14:43:58 +01:00
Alexey Bezhan
c9ca720959 Change NotificationHistory.updated_at on update
Sets the updated_at to current time when the NotificationHistory
is modified (which happens occasionally for example to set status
to returned letter).
2018-09-13 14:09:09 +01:00
Rebecca Law
5b25b682d4 Merge pull request #2088 from alphagov/remove-trigger-letter-pdfs-for-day
Remove trigger-letter-pdfs-for-day
2018-09-13 13:30:04 +01:00
Rebecca Law
9b6d784876 Merge pull request #2087 from alphagov/remove-scheduled-notification-from-schema
Don't join to scheduled_notifications
2018-09-13 11:59:12 +01:00
Rebecca Law
f1b04193ca In this PR we remove trigger-letter-pdfs-for-day scheduled task and just call collate_letter_pdfs_for_day instead.
There was a datetime bug in the query which resulted in files not being sent to the postal provider.
The trigger-letter-pdfs-for-day task is no longer needed, so rather than fix the query just call collate_letter_pdfs_for_day directly.
Less code is always better.

Deployment considerations: I realized this is strictly not backwards compatible if the scheduled job is in progress and a task is on the queue that no longer exists. This is ok since we will deploy this well before 17:50.
2018-09-12 17:16:34 +01:00
Katie Smith
ae1ee85d12 Merge pull request #2049 from alphagov/pyup-update-sqlalchemy-1.2.10-to-1.2.11
Update sqlalchemy to 1.2.11
2018-09-12 11:24:28 +01:00
Katie Smith
3926453b1e Merge pull request #2079 from alphagov/pyup-update-pytest-cov-2.5.1-to-2.6.0
Update pytest-cov to 2.6.0
2018-09-12 11:24:19 +01:00
Katie Smith
36f11ab0d0 Merge pull request #2085 from alphagov/pyup-update-pytest-3.7.4-to-3.8.0
Update pytest to 3.8.0
2018-09-12 11:24:10 +01:00
Rebecca Law
f84087cd63 For the NotificationWithTemplateSchema exclude the scheduled_notifications so we do not query that table.
The scheduled_notifications is not used as of yet.
2018-09-11 16:52:56 +01:00
Rebecca Law
39b90f0b78 Merge pull request #2083 from alphagov/fix-date-conversion
Fix date conversion bug
2018-09-10 14:44:12 +01:00
Alexey Bezhan
aacc00e3a7 Merge pull request #2075 from alphagov/process-returned-letters-list
Process returned letters list
2018-09-07 14:54:56 +01:00
Rebecca Law
555df6b62d Merge pull request #2086 from alphagov/user-name-for-csv-download
Add created_by_name to the Notification.serialize_for_csv.
2018-09-07 11:37:32 +01:00
Rebecca Law
8aacfb289d Add created_by_name to the Notification.serialize_for_csv.
The concern about performnace degrading has been thought through. We do not believe there will be an adverse effect since the high volume users do not send off messages.
2018-09-07 10:22:45 +01:00
Alexey Bezhan
3787e2954b Add a task to process returned letter lists
Adds an API endpoint `/letters/returned` that accepts a list of
notification references and creates a task to update their status.

Adds a new task that uses the list of references to update the status
of notifications to 'returned-letter'.

The update is currently done using a single query and logs the
number of changed records (including notification history records).
This could potentially be done within the `/letters/returned` endpoint,
but creating a job right away allows us to extend this more easily
in the future (e.g. logging missing notifications or adding callbacks).

The job is using the database tasks queue.
2018-09-06 16:39:17 +01:00
pyup-bot
f8229806b1 Update pytest from 3.7.4 to 3.8.0 2018-09-06 14:48:33 +01:00
Alexey Bezhan
18ab7f3337 Add updated history count to dao_update_notifications_by_reference
For returned letter updates most notifications won't exist in the
notifications table, so in order to find out whether the reference
matches any known letters we need to check the count of updated
history records.
2018-09-04 16:55:22 +01:00
Alexey Bezhan
0dcf04def9 Add notification status for returned letters
We need to update letter notifications with a new status when DVLA
gives us a list of references for returned letters.

This adds the new status to the models and the DB.

DVLA call this 'returned mail', so I'm using it as the status name
since it seems less ambiguous than 'returned'.
2018-09-04 16:55:22 +01:00
Rebecca Law
af83e89ed6 Fix problem with invalid seconds in the timestamp of the dvla response file.
We got a file that had 60 for the seconds in the timestamp, which is not valid (0-59). This ignores the seconds in the timestamp to get around that.
2018-09-04 16:09:56 +01:00
Chris Hill-Scott
db64423ca8 Merge pull request #2081 from alphagov/add-domain-constraint-2
Add domain constraint 2
2018-09-04 14:47:38 +01:00
Chris Hill-Scott
d52ee4606a Add error handler for duplicate domain 2018-09-04 14:40:24 +01:00
Chris Hill-Scott
dcacce1a2c Merge pull request #2078 from alphagov/email-preheader
Bump utils to start sending email preheaders
2018-09-04 14:15:22 +01:00
Chris Hill-Scott
5d5047fb13 Add unique constraint to email branding domains
Does two things:

1. Revert "Revert "Add unique constraint to email branding domain""

This reverts commit af9cb30ef3.

2. Don’t allow empty string in email branding domain

Columns with multiple `null`s can have a uniqueness constraint. Columns
with multiple empty string values are not considered unique.

This commit:
- removes any duplicate empty string values
- casts empty strings to null string any time these columns are updated

---

Squashed into this single commits because these two things are not
atomic as individual commits.
2018-09-04 11:10:46 +01:00
Chris Hill-Scott
55b7b3b157 Merge pull request #2080 from alphagov/revert-2077-add-domain-constraint
Revert "Add unique constraint to email branding domain"
2018-09-04 11:01:40 +01:00
Chris Hill-Scott
af9cb30ef3 Revert "Add unique constraint to email branding domain" 2018-09-04 10:55:49 +01:00
Chris Hill-Scott
036974ca05 Merge pull request #2071 from alphagov/pyup-update-pytest-3.7.3-to-3.7.4
Update pytest to 3.7.4
2018-09-04 10:37:22 +01:00
Chris Hill-Scott
f1aa02f40c Merge branch 'master' into pyup-update-pytest-3.7.3-to-3.7.4 2018-09-04 10:22:12 +01:00
Chris Hill-Scott
129d45fcfd Merge pull request #2070 from alphagov/pyup-update-moto-1.3.4-to-1.3.5
Update moto to 1.3.5
2018-09-04 10:21:48 +01:00
Chris Hill-Scott
95936533e9 Merge pull request #2077 from alphagov/add-domain-constraint
Add unique constraint to email branding domain
2018-09-04 10:20:55 +01:00
Chris Hill-Scott
348461f38e Merge pull request #2074 from alphagov/pyup-update-coveralls-1.4.0-to-1.5.0
Update coveralls to 1.5.0
2018-09-04 10:20:49 +01:00
Chris Hill-Scott
f095fa1ddf Add unique constraint to email branding domain
Brandings with a domain set should be considered canonical. It doesn’t
make sense to have the same domain set on multiple different email
brands – you can’t tell which one to use.
2018-09-04 09:46:50 +01:00
pyup-bot
8ae58d11c4 Update pytest-cov from 2.5.1 to 2.6.0 2018-09-04 01:31:28 +01:00
Chris Hill-Scott
33f1c9a41b Bump utils to start sending email preheaders
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/523/files

Changes: https://github.com/alphagov/notifications-utils/compare/30.1.1...email-preheader
2018-09-03 17:48:27 +01:00
Chris Hill-Scott
f39f91e0eb Merge pull request #2073 from alphagov/drop-service-branding
Drop service branding column
2018-08-31 16:35:26 +01:00
Chris Hill-Scott
834ad73304 Drop service branding column
We’re not using this column any more, so let’s clean up after ourselves.
2018-08-31 15:56:25 +01:00
Chris Hill-Scott
80de4d2ded Merge pull request #2072 from alphagov/deprecate-service-branding
Deprecate service branding and `govuk` brand type
2018-08-31 15:55:47 +01:00
pyup-bot
66431f82be Update coveralls from 1.4.0 to 1.5.0 2018-08-31 06:34:21 +01:00
Chris Hill-Scott
0c47d41977 Remove govuk from possible brands
‘GOV.UK’ doesn’t make sense as a type of brand. It only made sense as
a type of branding that a service had.

Since we’ve:
- deprecated the service branding column
- made sure it’s not used as a value in the email branding table

we can remove this value from the table of possible brand types.
2018-08-30 16:36:35 +01:00
Chris Hill-Scott
337496c5bc Deprecate service branding column
We want to drop this column. First we have to stop using it anywhere.

Needs to be made nullable so we can stop writing to it.
2018-08-30 16:05:37 +01:00
pyup-bot
e24d088683 Update pytest from 3.7.3 to 3.7.4 2018-08-29 22:33:19 +01:00
Chris Hill-Scott
6a57411fa0 Merge pull request #2069 from alphagov/email_brand_type_non_nullable
Make branding type non-nullable
2018-08-29 15:46:27 +01:00
pyup-bot
a8d011cdd3 Update moto from 1.3.4 to 1.3.5 2018-08-29 13:59:23 +01:00
Leo Hemsted
889fd796fb Merge pull request #2057 from alphagov/sanitise-precompiled
Sanitise precompiled pdfs after virus scan
2018-08-29 12:53:27 +01:00
Chris Hill-Scott
11225b7149 Make branding type non-nullable
We’ve already removed all the `null` values, and made it impossible to
add new brandings with a `null` brand type.

Making it a database constraint just gives us extra safety.
2018-08-29 12:46:21 +01:00
Chris Hill-Scott
de396ebec9 Merge pull request #2068 from alphagov/pyup-update-pytest-3.7.1-to-3.7.3
Update pytest to 3.7.3
2018-08-29 10:08:52 +01:00
pyup-bot
41b9a0891f Update pytest from 3.7.1 to 3.7.3 2018-08-29 10:00:55 +01:00
Chris Hill-Scott
ea643bef02 Merge pull request #2067 from alphagov/pyup-update-pytest-xdist-1.22.5-to-1.23.0
Update pytest-xdist to 1.23.0
2018-08-29 09:59:00 +01:00
pyup-bot
cb9966cfdf Update pytest-xdist from 1.22.5 to 1.23.0 2018-08-29 09:50:11 +01:00
Chris Hill-Scott
e5f94913a6 Merge pull request #2055 from alphagov/pyup-update-coveralls-1.3.0-to-1.4.0
Update coveralls to 1.4.0
2018-08-29 09:49:48 +01:00