rename sending_date to created_at

we don't name letters based on the day we send them on, rather, the day
we create them on. If we process a letter for a second time for whatever
reason, even if it's a couple of days later, it'll still go in a folder
based on the created_at timestamp. There's still a slight confusion,
however - if the timestamp is after 5:30pm, the folder will be for the
day after. However, still the day after creation, so I think created_at
still makes the most sense.

Remove the term `sending_date` to try and make this relationship more
apparent.
This commit is contained in:
Leo Hemsted
2020-09-21 14:40:22 +01:00
parent 4f1e5ee5a3
commit 1e928a926a
6 changed files with 21 additions and 21 deletions

View File

@@ -63,7 +63,7 @@ def get_pdf_for_templated_letter(self, notification_id):
letter_filename = get_letter_pdf_filename(
reference=notification.reference,
crown=notification.service.crown,
sending_date=notification.created_at,
created_at=notification.created_at,
ignore_folder=notification.key_type == KEY_TYPE_TEST,
postage=notification.postage
)
@@ -182,7 +182,7 @@ def get_key_and_size_of_letters_to_be_sent_to_print(print_run_deadline, postage)
letter_file_name = get_letter_pdf_filename(
reference=letter.reference,
crown=letter.service.crown,
sending_date=letter.created_at,
created_at=letter.created_at,
postage=letter.postage
)
letter_head = s3.head_s3_object(current_app.config['LETTERS_PDF_BUCKET_NAME'], letter_file_name)
@@ -311,7 +311,7 @@ def process_sanitised_letter(self, sanitise_data):
upload_file_name = get_letter_pdf_filename(
reference=notification.reference,
crown=notification.service.crown,
sending_date=notification.created_at,
created_at=notification.created_at,
ignore_folder=True,
postage=notification.postage
)