Refactor the code that figures out what folder and filename to use for the letter pdf files.

Now we consistently use the created_at date, so we can always get the right file location and name.

The previous updates to this code were trying to solve the problem if a pdf being created at 17:29, but not ready to upload until 17:31 after the antivirus and validation check.
But in those cases we would have trouble finding the file.
This commit is contained in:
Rebecca Law
2019-09-16 14:20:40 +01:00
committed by Leo Hemsted
parent a10aaddbcc
commit 702d8fa85f
5 changed files with 45 additions and 42 deletions

View File

@@ -178,8 +178,9 @@ def send_pdf_letter_notification(service_id, post_data):
)
upload_filename = get_letter_pdf_filename(
notification.reference,
notification.service.crown,
reference=notification.reference,
crown=notification.service.crown,
sending_date=notification.created_at,
is_scan_letter=False,
postage=notification.postage
)