mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
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