Commit Graph

5586 Commits

Author SHA1 Message Date
Chris Hill-Scott
63519e392f Merge pull request #2035 from alphagov/pyup-update-moto-1.3.3-to-1.3.4
Update moto to 1.3.4
2018-08-29 09:49:42 +01:00
Chris Hill-Scott
38096eb93e Merge pull request #2051 from pwright08/add-create-secret-code-unit-tests
Add unit tests for the Users DAO create_secret_code function
2018-08-29 09:49:36 +01:00
Chris Hill-Scott
e9a3216295 Merge pull request #2066 from alphagov/default-email-branding-IS-null
Set branding_type to org if it’s none
2018-08-28 17:37:30 +01:00
Chris Hill-Scott
0107cdcfde Set branding_type to org if it’s none
Same as a0deef06e2 but with `is null` not
`= null` 🤦🏻
2018-08-28 17:24:14 +01:00
Chris Hill-Scott
3b1d45a4e8 Merge pull request #2065 from alphagov/nhs-letter
Add NHS logo for letters
2018-08-28 17:03:14 +01:00
Chris Hill-Scott
a71ce9fb54 Add NHS logo for letters
Matches: https://github.com/alphagov/notifications-template-preview/pull/192
2018-08-28 16:56:42 +01:00
Chris Hill-Scott
76f9b80444 Merge pull request #2064 from alphagov/look-in-branding-brand_type
Look in email_branding for brand_type, not service
2018-08-28 16:54:15 +01:00
Chris Hill-Scott
a0deef06e2 Set branding_type to org if it’s none
So later we can:
- make it non-nullable later
- remove `govuk` as an option

This is mostly for people’s local databases, the manual work here has
been done on production already.
2018-08-28 16:22:42 +01:00
Chris Hill-Scott
2671ca3e5e Look in email_branding for brand_type, not service
https://www.pivotaltracker.com/story/show/159986276

We are now setting the type of branding on the branding itself, not on
the service.

This commit switches over from looking in the old place (on the service)
to looking in the new place (on the branding).
2018-08-28 16:22:41 +01:00
Rebecca Law
a21972d7b6 Merge pull request #2059 from alphagov/remove-db-colour-columns
Remove db columns
2018-08-24 16:23:20 +01:00
Rebecca Law
a960d2fb1d Remove db columns 2018-08-24 16:09:17 +01:00
Rebecca Law
099216c414 Merge pull request #2058 from alphagov/remove-db-migration
Need to do the data migration after removing the columns in the code.
2018-08-24 16:04:55 +01:00
Rebecca Law
25c5e0ceb8 Need to do the data migration after removing the columns in the code. 2018-08-24 15:51:28 +01:00
Rebecca Law
a7aae2a5c1 Merge pull request #2056 from alphagov/remove-new-colours
Remove new colours - they are not needed
2018-08-24 15:25:07 +01:00
Leo Hemsted
40c537a9f5 add tests 2018-08-24 15:12:02 +01:00
Rebecca Law
45632293b2 Remove new colour columns 2018-08-24 13:53:04 +01:00
Rebecca Law
562facb49c Now that EmailBranding includes the brand type we do not need two separate colours. This PR removes the new colour columns. 2018-08-24 13:51:11 +01:00
Rebecca Law
44818a91e7 Merge pull request #2054 from alphagov/add-brand-type-to-email-branding
Add brand_type to EmailBranding.
2018-08-24 10:13:44 +01:00
pyup-bot
ccb12dc963 Update coveralls from 1.3.0 to 1.4.0 2018-08-24 03:49:06 +01:00
Sakis
bcfef1990f Merge pull request #2052 from alphagov/remove-header-check-preview
Disable header check on preview
2018-08-23 17:12:25 +01:00
Leo Hemsted
001f84b0b8 Sanitise PDFs after virus scan
Notify antivirus, on success, calls the process_virus_scan_passed taks.
Previously, this task would:

* update status to created (or delivered for test keys)
* copy the file from the scan bucket to either the live or test bucket
  based on the results
* delete the old file in the scan bucket

We want it to:

* download file from scan bucket
* sanitise PDF using new template-preview functionality
* if sanitise failed, set to new status "validation-failed" and save
  the pdf somewhere.
* send new pdf to live/test bucket
* update status to created (or delivered for test keys)
* delete the original file in the scan bucket

This PR does some of that:

* download file from scan bucket
* sanitise PDF using new template-preview functionality
* if sanitise failed, just log.
* send OLD pdf to live/test bucket
* update status to created (or delivered for test keys)
* delete the original file in the scan bucket

So if sanitising fails, we won't fall over and not deliver the letter,
we'll just log a message for now. If sanitise throws an unexpected
error (as opposed to a 400), we'll retry up to fifteen times (the same
as when creating a new letter). I've added the code for using the
sanitised pdf, but it's commented out for now
2018-08-23 16:16:40 +01:00
Rebecca Law
6c5e60f0a9 Fix merge conflicts 2018-08-23 15:04:44 +01:00
Rebecca Law
4fe1e6bb66 Merge branch 'master' into add-brand-type-to-email-branding 2018-08-23 15:02:55 +01:00
Rebecca Law
6265c63a0e Merge pull request #2053 from alphagov/pension-wise-letter-logo
Add letter logo for Pension Wise
2018-08-23 14:58:27 +01:00
Rebecca Law
f80cd508ac Fix name typo 2018-08-23 14:43:41 +01:00
Rebecca Law
3816010c72 Add brand_type to EmailBranding.
It makes more sense to put the brand_type with EmailBranding rather than in Service.
Next step is to add the new type to the form in admin app.
2018-08-23 13:53:05 +01:00
Chris Hill-Scott
a950425882 Add letter logo for Pension Wise 2018-08-23 13:38:56 +01:00
Athanasios Voutsadakis
1e4c2ee796 Disable header check on preview
This header was introduced to ensure that no traffic was being
directed straight to the .cloudapps.digital domain. This was especially
useful for the non-production environments where access to the proper
domains is allowed for specific IP addresses while the cloudapps.digital
ones are open.

Moving to paas custom domains [1] will allow us to stop using the paas
proxies and, as a result, unbind the cloudapps.digital domain from our
apps.

This means that the X-Custom-Forwarder will become obsolete since all
our requests will be coming directly to our domain (albeit through
cloudfront) so any IP restriction can be implemented with a route
service [2].

1: https://docs.cloud.service.gov.uk/deploying_services.html#set-up-a-custom-domain-using-the-cdn-route-service
2: https://docs.cloud.service.gov.uk/deploying_services.html#route-services
2018-08-23 13:23:14 +01:00
Paul Wright
267a82758a Add unit tests for the Users DAO create_secret_code function 2018-08-23 12:18:47 +01:00
Chris Hill-Scott
c067aea68f Merge pull request #2048 from alphagov/email-colours-and-domain
Add banner_colour, single_id_color and domain to email_branding.
2018-08-22 16:04:14 +01:00
Rebecca Law
fd16d7060a Added a method to decide which colour to send to the notifications-utils HTMLEmailTemplate to create the content. 2018-08-22 12:59:06 +01:00
Chris Hill-Scott
fc337a7d5a Freeze requirements 2018-08-21 11:38:53 +01:00
pyup-bot
3b610fbf64 Update sqlalchemy from 1.2.10 to 1.2.11 2018-08-20 22:25:59 +01:00
Rebecca Law
47892168d6 Merge pull request #2047 from alphagov/bump-utils
Bump the utils requirement.
2018-08-20 13:24:36 +01:00
Rebecca Law
0b0e551626 Add banner_colour, single_id_colour, and domain to email_branding_schema.
The Admin app can now be updated to send the new columns to update/create email_branding
2018-08-20 10:57:42 +01:00
Rebecca Law
d055fabf17 Bump the utils requirement.
This helped with some of the dependency warnings but not all.
2018-08-20 10:33:15 +01:00
Rebecca Law
1658f4de71 Merge pull request #2045 from alphagov/email-branding-colors-and-domain
New columns for EmailBranding.
2018-08-17 12:56:32 +01:00
Katie Smith
60ecb7ddce Merge pull request #2043 from alphagov/increase-sms-size
Increase SMS maximum length from 495 to 612
2018-08-17 12:13:18 +01:00
Rebecca Law
640a400165 DB update script - missing from last commit 2018-08-16 17:10:02 +01:00
Rebecca Law
df2271a49f New columns for EmailBranding.
There is a requirement for the colour of the banner to be different to the single id colour. In order to accomodate that we are adding two new columns for that data.
These columns will be updated manually and not done with a data migration.

A new column called domain has been added. This will be used as a default domain, if the user that creates the service has a matching domain this email brand will be set for the service.

This PR only adds the new columns to the model and db.

https://www.pivotaltracker.com/story/show/159660295
2018-08-16 16:57:53 +01:00
Katie Smith
a87be9b74a Use new value of SMS_CHAR_COUNT_LIMIT from utils
Admin, API and utils were all defining a value for SMS_CHAR_COUNT_LIMIT.
This value has been updated in notifications-utils to allow text
messages to be 4 fragments long and notifications-api now gets the value of
SMS_CHAR_COUNT_LIMIT from notifications-utils instead of defining it in
config.

Also updated some tests to check for the higher limit.
2018-08-16 16:34:34 +01:00
Katie Smith
85af1e7fe8 Bump utils to version 30.1.0
Bumped notifications-utils to bring in the new value for
`SMS_CHAR_COUNT_LIMIT`
2018-08-16 15:59:51 +01:00
Alexey Bezhan
025f805992 Merge pull request #2042 from alphagov/get-retention-by-type
Get service data retention by notification type
2018-08-16 12:06:51 +01:00
Alexey Bezhan
1e3004ab3a Add service stats dao tests with variable days limit 2018-08-15 11:10:16 +01:00
Tom Byers
a96db4b122 Merge pull request #2039 from alphagov/bump-utils
Bump utils to 29.3.6
2018-08-13 16:48:38 +01:00
Alexey Bezhan
ab428048b9 Add an endpoint to fetch service data retention by type
Admin app needs to get the service data retention for the specified
notification type, so to avoid iterating through the list of all
existing service data retention settings we restore the endpoint
to get the individual data retention period.
2018-08-13 16:45:57 +01:00
Alexey Bezhan
5f2724c429 Add limit_days argument to notification statistics endpoint
Allows getting notification counts for a given number of days to
support services with custom data retention periods (admin dashboard
page should still display counts for the last 7 days, while the
notifications page displays all stored notifications).
2018-08-13 16:45:57 +01:00
Rebecca Law
3e51b69df6 Merge pull request #2037 from alphagov/fix-email-branding
This PR fixes the check for the text key in the post data.
2018-08-13 15:17:02 +01:00
Rebecca Law
eb2c59a920 Merge pull request #2041 from alphagov/another-fix-for-delete-letters
Fixes to the delete letter notifications.
2018-08-13 14:28:43 +01:00
Rebecca Law
f965322f25 Fixes to the delete letter notifications.
If there are no files to delete we won't get an excpetion.
Wrap the delete file in a try/except to avoid stopping the entire task.
Fix the missing slash for the file name.
2018-08-13 14:09:51 +01:00