Commit Graph

2852 Commits

Author SHA1 Message Date
Rebecca Law
ecc4cde4de Update the get_notification_by_id to return a sensible message if the id is not a valid UUID.
Previously "Result not found" would be returned when the id is not a valid uuid, which does not make sense.
Now the message says "notification_id is not a valid UUID", this should be a clearer message for the client service.
2018-04-03 16:37:41 +01:00
Sakis
f06bd20900 Merge pull request #1809 from alphagov/revisit-proxy-header-check
Revisit proxy header check
2018-04-03 10:55:41 +01:00
venusbb
52aeec2247 bug fix: use date only when comparing unique records rather than datetime 2018-03-29 11:42:31 +01:00
Athanasios Voutsadakis
331500ce94 Merge branch 'master' into revisit-proxy-header-check 2018-03-28 15:38:56 +01:00
Venus Bailey
a883fc54d8 Merge pull request #1807 from alphagov/vb-report-tasks
Billing database tweak and BST bug fix
2018-03-28 11:01:18 +01:00
venusbb
cf766313e6 Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-report-tasks 2018-03-28 10:53:45 +01:00
venusbb
83aa1b9fa3 use datetime.combine rather than parser.parse 2018-03-28 10:52:37 +01:00
Athanasios Voutsadakis
463f1eefaf Move proxy header check to auth-requiring endpoints
The main drive behind this is to allow us to enable http healthchecks on
the `/_status` endpoint. The healthcheck requests are happening directly
on the instances without going to the proxy to get the header properly
set.

In any case, endpoints like `/_status` should be generally accessible by
anything without requiring any form of authorization.
2018-03-27 17:37:09 +01:00
Rebecca Law
63e85e3511 Merge pull request #1806 from alphagov/update-logging
Update logging for provider tasks.
2018-03-27 14:04:12 +01:00
Richard Chapman
20179af6e6 Merge pull request #1802 from alphagov/rc_add_virus_scan_error_task
Added a new task to handle any error cases with the anti-virus
2018-03-27 14:03:24 +01:00
Richard Chapman
023862dfdc Refactored code to be more Pythonic and make the code more readable 2018-03-27 13:32:46 +01:00
venusbb
2262db4f62 Database tweak and BST bug fix 2018-03-27 10:37:56 +01:00
Richard Chapman
3299055a09 Refactored the shared code between
move_scanned_pdf_to_test_or_live_pdf_bucket and
move_failed_pdf to consolidate some code so it is easier to maintain in
future as so that _move_s3_object can be used for any new methods.
2018-03-27 10:32:40 +01:00
Alexey Bezhan
04a643a777 Add a service permission for uploading documents to Document Download
Service permission allows attaching a file to a notification API request
that gets uploaded to Document Download API.
2018-03-27 10:16:56 +01:00
Rebecca Law
c75458cee9 Revert change to exception log. 2018-03-26 16:44:29 +01:00
Rebecca Law
598539dcb3 Update logging for provider tasks.
Move the info message before the fetch.
Include the exception in the log message.
2018-03-26 15:24:21 +01:00
Richard Chapman
8b6d28d3b0 Added a new task to handle any error cases with the anti-virus
application. If the Anti-virus app fails due to s3 errors or ClamAV
so does not scan (even after retries) the file at all an error needs
to be raised and the notification set to technical-failure.

Files should be moved to a 'folder' a separate one for ERROR and FAILURE.

* Added new letter task to process the error
* Added a new method to letter utils.py to move a file into an error or
failure folder based on the input
* Added tests to test the task and the utils.py method
2018-03-26 14:18:44 +01:00
Rebecca Law
bdae669b05 Merge pull request #1800 from alphagov/replay-created-emails
Replay emails and sms that are still in created
2018-03-26 10:56:55 +01:00
Rebecca Law
0701b2546d Remove test crontab minute 2018-03-26 10:30:08 +01:00
Rebecca Law
9549ada200 Run task every 15 minutes.
Move variable to task from config.
2018-03-26 10:26:24 +01:00
Rebecca Law
612843d509 Run every 15 minutes not 15 minutes past the hour 2018-03-26 09:43:53 +01:00
Rebecca Law
28e78780d0 Added more logging for provider tasks. 2018-03-26 09:31:52 +01:00
Rebecca Law
fc21121764 Check input is a UUID 2018-03-23 16:11:43 +00:00
Rebecca Law
40e535e112 Add the scheduled task to run every 15 minutes. 2018-03-23 16:00:13 +00:00
Rebecca Law
6dad9b43db New command to create-pdf-letter task for a given notification id.
After a notificaiton is created we create a task to create the pdf and save it to S3,
if for some reason that task does not run we are left with notifications that are not sent.
This should not happen, but if it does we have a way to continue sending the letter.
2018-03-23 15:47:01 +00:00
Rebecca Law
f596d17bf2 If a sms or email has not been sent after 4 hours and 15 minutes then put it on the delivery queue. 2018-03-23 15:38:35 +00:00
kentsanggds
5d38989cd9 Merge pull request #1797 from alphagov/ken-test-key-antivirus
Add antivirus check on precompiled letters sent with test key
2018-03-23 15:04:08 +00:00
Ken Tsang
1a9bc2a5cf Move test letters to test letters bucket without date folder name 2018-03-23 14:59:48 +00:00
Ken Tsang
2f09c943f7 Change error log to exception log for pdfs failing virus scans 2018-03-23 14:24:23 +00:00
Venus Bailey
d14ac2aa81 Merge pull request #1795 from alphagov/vb-report-tasks
Fixed a bug on reporting_tasks
2018-03-23 14:04:12 +00:00
Ken Tsang
0ee5c33084 Add antivirus check on precompiled letters sent with test key
- precompiled PDFs sent by test key uploaded to scan bucket
- set status to VIRUS-SCAN-FAILED for pdfs failing virus scan rather than PERMANENT-FAILURE
- Make call to AV app for precompiled letters sent via a test key, and set notification status to PENDING-VIRUS-SCAN
2018-03-23 12:04:37 +00:00
venusbb
55a27fed13 fixed a bug on reporting_task 2018-03-23 11:40:27 +00:00
Chris Waszczuk
9bf739007a Merge pull request #1790 from alphagov/update-paginated-inbound-sms-method
Update inbound sms method
2018-03-23 11:25:47 +00:00
chrisw
ac50250ad7 update paginated inbound sms method 2018-03-23 11:09:51 +00:00
kentsanggds
832c350b69 Merge pull request #1789 from alphagov/ken-fix-no-sent_by
Set sent_by if not set during sms provider callback
2018-03-23 09:52:26 +00:00
Venus Bailey
8c282aa406 Merge pull request #1791 from alphagov/vb-report-tasks
Add statd to monitoring the length of task
2018-03-22 17:22:36 +00:00
venusbb
444365faa5 add statd 2018-03-22 17:17:03 +00:00
Ken Tsang
c272d023c4 Lowercase the client name when sent_by is empty 2018-03-22 16:12:33 +00:00
Venus Bailey
1d7381400d Merge pull request #1787 from alphagov/vb-report-tasks
Command for migrating data to ft_billing [#155511547]
2018-03-22 09:37:46 +00:00
Ken Tsang
ffa093d8c7 Set sent_by if not set during sms provider callback
- refactored argument reference to provider_reference to make it clearer
2018-03-21 18:11:10 +00:00
venusbb
9aa2536997 use sql parametrize rather than python format 2018-03-21 17:04:51 +00:00
kentsanggds
5dc0248043 Merge pull request #1783 from alphagov/ken-process-antivirus
Send task to antivirus app and process antivirus callbacks
2018-03-21 16:39:55 +00:00
Ken Tsang
d6f6669610 Add comments for copying s3 objects 2018-03-21 16:33:49 +00:00
venusbb
4b25654cbf update record rather than ignore when duplicate 2018-03-21 15:37:49 +00:00
Ken Tsang
5481d743ac change failed virus scan log to error 2018-03-21 15:30:58 +00:00
venusbb
b9953dd005 Command to migrate data to ft_billing 2018-03-21 15:21:16 +00:00
venusbb
af975b89ec primary key for ft_billing should use notification_type 2018-03-21 15:02:08 +00:00
venusbb
378feda603 put import reporting_tasks in config 2018-03-21 10:39:00 +00:00
venusbb
cf019864e2 Preserve 'unknown' in ft_billing for sms if the provider is not known. 2018-03-21 09:50:34 +00:00
venusbb
ecef20523b Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-report-tasks 2018-03-20 17:24:32 +00:00