Commit Graph

4760 Commits

Author SHA1 Message Date
chrisw
a487293bf0 Add check org name is unique endpoint 2018-03-06 15:34:39 +00:00
Chris Hill-Scott
d7823fdbd6 Merge pull request #1739 from alphagov/backfill-performance-totals
Add command to backfill Performance Platform totals
2018-03-06 09:38:26 +00:00
Richard Chapman
271e157d1a Merge pull request #1737 from alphagov/add_precompiled_letters
Updated API to handle pre-compiled pdfs
2018-03-06 08:39:49 +00:00
Richard Chapman
bfdd385ba3 Tidied up imports. Removed local imports and made a global import so its
easier to maintain in future.
2018-03-05 17:08:09 +00:00
Chris Hill-Scott
ca167206d5 Add command to backfill Performance Platform totals
We don’t have any way of playing back the totals we send to performance
platform.

This commit copies the command used to backfill the processing time and
adapts it to backfill the totals instead. Under the hood it uses the
same code that we use in the scheduled tasks to update performance
platform on a daily basis. I had to modify this code to take a `day`
argument because it was hardcoded to only work for ‘yesterday’.
2018-03-05 17:02:33 +00:00
Richard Chapman
033a4099bc Added tests for all conditions for s_precompiled_letter.
* Added tests for hidden = true but name not precompiled
* Added test where name is precompiled but hidden is false
2018-03-05 16:57:48 +00:00
Richard Chapman
e91a0efc43 Refactored code to make it more maintainable and changed an error type
* Rather than an abort 404 returned a 500 and InvalidRequest so that the
error is more easily handled on the admin console. If the file is
missing but expected to be there is actually an internal error for admin
* Refactored the code to remove duplicate code in calls to template
preview by creating a new private method which is called with specific
parameters
2018-03-05 14:54:18 +00:00
Chris Hill-Scott
98d5408d7d Merge pull request #1727 from alphagov/pyup-update-pytest-mock-1.7.0-to-1.7.1
Update pytest-mock to 1.7.1
2018-03-05 14:52:15 +00:00
Chris Hill-Scott
e972b97226 Merge pull request #1735 from alphagov/pyup-update-coveralls-1.2.0-to-1.3.0
Update coveralls to 1.3.0
2018-03-05 14:52:06 +00:00
Chris Hill-Scott
2d45070086 Merge pull request #1734 from alphagov/count-letters-performance-platform
Send count of sent letters to performance platform
2018-03-05 14:51:47 +00:00
Richard Chapman
a4feaba309 Added tests to tests for precompiled flow and refactored a little
* Added is_precompiled_letter method to letter/utils.py
* Added tests for letter/utils.py
* Added tests for the rest endpoint
* Moved the Precompiled name to a central location
* Added hidden field to the test method to create a template
2018-03-05 14:11:37 +00:00
pyup-bot
5e44449e66 Update coveralls from 1.2.0 to 1.3.0 2018-03-03 00:00:41 +00:00
Chris Hill-Scott
7e1aa03371 Send count of sent letters to performance platform
Now we’ve been sending real letters for quite a while it would be nice
to show how many.
2018-03-02 16:54:48 +00:00
Richard Chapman
a9a67ce542 Updated API to handle pre-compiled pdfs
* added a method to letter/utils.py to get the PDF document from the S3
bucket
* added the logic to return the pdf or to produce a png of the pdf
2018-03-02 14:54:28 +00:00
Rebecca Law
d4db959a55 Merge pull request #1731 from alphagov/process-old-letter-responses
Process old letter responses
2018-03-02 12:35:47 +00:00
Rebecca Law
8aea452df9 Because research mode and test keys do not create notification history, a try except block has been added. 2018-03-02 11:37:15 +00:00
Rebecca Law
c474b2312b Process responses for letters even after the notification has been deleted.
This will continue to update the notification history for letter notifications.
We currently have an issue where the responses to letters from the provider is taking a long time.
This is due to the manual nature of their process.
Updating the status of the letter will still work if the notification has been purged.

Also turned back on the purge letter notification scheduled task.
2018-03-02 11:29:22 +00:00
Rebecca Law
a6de9142cf Merge pull request #1721 from alphagov/remove-old-letter-flow
Remove old letter flow
2018-03-02 11:23:07 +00:00
Rebecca Law
d6c929d127 Another unused method to delete 2018-03-02 11:05:06 +00:00
Rebecca Law
bffc4863db Remove all methods no longer used now that we only send pdf files to DVLA. 2018-03-02 11:05:05 +00:00
Rebecca Law
304f4d5c67 Remove unused methods 2018-03-02 11:05:05 +00:00
kentsanggds
2e958cfdd2 Merge pull request #1725 from alphagov/rc_add_get_template_preview
Add get template preview
2018-03-01 15:18:07 +00:00
Richard Chapman
42c1040604 Updated API to get it working with Admin.
* Added missing items from template which are required
* Returned the file as a JSON string with the file as a base64 encoded
string
* Updated tests to match teh desired format
2018-03-01 15:01:46 +00:00
Richard Chapman
4c8bc9f430 Added endpoint to get the letter preview from the template preview app
Is will allow the admin application to call into the api instead of
making the call itself. This will allow the api to make decision for
precompiled pdf without having to update the admin app.

- Added new endpoint
- Added tests for the endpoint
2018-03-01 15:01:46 +00:00
Rebecca Law
99a3dc8959 Merge pull request #1726 from alphagov/add-notification-id-to-log
Update log message
2018-03-01 12:19:48 +00:00
Rebecca Law
60b1c0ff5c Merge pull request #1728 from alphagov/remove-job-to-delete-letters
Suspend the `delete-letter-notifications` scheduled job.
2018-03-01 12:18:07 +00:00
Rebecca Law
be7989bbc9 Suspend the delete-letter-notifications scheduled job.
We have an issue with the provider. If we need to resend these letters, we need the notification.
2018-03-01 11:47:00 +00:00
pyup-bot
d0ed3bcacc Update pytest-mock from 1.7.0 to 1.7.1 2018-03-01 11:11:18 +00:00
Chris Hill-Scott
1eab7b7d4f Merge pull request #1723 from alphagov/no-priority-example
Remove priority flag from example templates
2018-03-01 11:11:10 +00:00
Rebecca Law
891a80addf Added notification id to the log message for upload pdf to make it easier to search for the letter notification in the logs. 2018-03-01 10:37:07 +00:00
Chris Hill-Scott
5134864a9e Merge pull request #1724 from alphagov/revert-1722-priority-one-off-2
Revert "Send one-off messages as fast as possible"
2018-03-01 10:34:54 +00:00
Chris Hill-Scott
9524e34ce1 Revert "Send one-off messages as fast as possible" 2018-03-01 10:17:59 +00:00
Chris Hill-Scott
f0d91bf1c5 Merge pull request #1722 from alphagov/priority-one-off-2
Send one-off messages as fast as possible
2018-03-01 09:38:09 +00:00
Chris Hill-Scott
08027947b2 Remove priority flag from example templates
Since we send all one off messages as priority
[now](https://github.com/alphagov/notifications-api/pull/1722), we don’t
need to explicitly mark the ‘Example text message template’ template as
being priority.

This commit retroactively removes the priority flag from these
templates, so that they can’t be reused to send other messages as
priority. I don’t think this is a real problem now, but worth cleaning
this up.

This query will hit approximately 827 templates.
2018-03-01 09:37:14 +00:00
Katie Smith
04ecea615b Merge pull request #1716 from alphagov/count-precompiled-letter-pages
Count the number of pages in pre-compiled letters
2018-02-28 16:50:38 +00:00
Katie Smith
bc619efc4e Count the number of pages in pre-compiled letters
We were already counting the billable units in PDFs that we generate.
We are now also counting the number of billable units in pre-compiled letters
and saving the result.
2018-02-28 16:14:25 +00:00
kentsanggds
0d2868625d Merge pull request #1720 from alphagov/ken-fix-failed-boto-mocks
Fix boto mocks in tests
2018-02-28 15:58:05 +00:00
Chris Hill-Scott
bc2e55a6b8 Send one-off messages as fast as possible
The vast majority of messages that are being sent one-off are
time-sensitive. A typical example is a caseworker on the phone who sends
a message at the end of the call. They normally wait until the message
has been delivered, so all the time they’re waiting is time when they
can’t be helping someone else.

What we don’t want to happen is for the messages they’re sending to get
stuck behind a big lump of GOV.UK Subscription emails or passport
reminder texts. I think the best way to do this is shift them onto the
priority queue.

We’re currently seeing queue sizes of up to 5,000 on the ‘normal’
queues; I don’t think there’s any risk of this change making the
priority queue more heavily-laden than this. Especially since the
traffic patterns of users sending one-off messages won’t be spiky.
2018-02-28 15:00:12 +00:00
Ken Tsang
b6401e4858 Fix boto mocks in tests
- was getting KeyError: 'Error' test failures due to the side_effect not generating enough information to be used in the ClientError class, this PR adds missing information.
2018-02-28 10:54:52 +00:00
Rebecca Law
d584ca4949 Merge pull request #1715 from alphagov/remove-deprecated-endpoint
Remove deprecated endpoints
2018-02-27 14:59:35 +00:00
Rebecca Law
12046ee85a There endpoint to check the token of an invitation for services and organisations have been merged.
This PR deletes the old endpoints.
2018-02-27 13:46:23 +00:00
Leo Hemsted
a87373571c Merge pull request #1714 from alphagov/reqs
bump requirements
2018-02-27 13:46:14 +00:00
Leo Hemsted
ab95a4501b bump requirements
notably, remove awscli and boto3 - they're both required by utils, and
are generating a lot of PR noise
2018-02-27 11:25:57 +00:00
kentsanggds
25d84af63e Merge pull request #1709 from alphagov/ken-fix-letter-serialization
Fix serialization on precompiled letter
2018-02-27 10:13:15 +00:00
Rebecca Law
6886cfcd82 Merge pull request #1710 from alphagov/org-user-endpionts
Fix db migration conflicts
2018-02-26 16:57:32 +00:00
Rebecca Law
0728c9f41a Fix db migration conflicts 2018-02-26 16:48:12 +00:00
Rebecca Law
7faf375375 Merge pull request #1695 from alphagov/org-user-endpoints
Organisation user endpoints
2018-02-26 16:27:01 +00:00
Ken Tsang
c14663d84a Fix serialization on precompiled letter
Postcodes are required for created letters, but not for precompiled, this fix allows postcodes to be None in the model.
As postcodes are still required for created letter they should be caught by validation schemas in the POST handler
2018-02-26 13:53:06 +00:00
Alexey Bezhan
8f08f691b2 Merge pull request #1708 from alphagov/non-nullable-hidden-templates
Set Templates.hidden column as non-nullable and filter hidden templates
2018-02-26 13:41:36 +00:00
Alexey Bezhan
984a5050db Don't return hidden templates in API service template responses
Brings back filtering hidden templates from the API responses.
2018-02-26 13:28:08 +00:00