Polish and test the small task that updates billable units for letter

This commit is contained in:
Pea Tyczynska
2020-05-05 11:17:22 +01:00
parent 24a89c1c19
commit 3a00c19390
3 changed files with 31 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ def create_letters_pdf(self, notification_id):
encrypted_data = encryption.encrypt(letter_data)
notify_celery.send_task(
name=TaskNames.CREATE_LETTER_PDF,
name=TaskNames.CREATE_PDF_FOR_TEMPLATED_LETTER,
args=(encrypted_data,),
queue=QueueNames.SANITISE_LETTERS
)
@@ -105,9 +105,10 @@ def update_billable_units_for_letter(self, notification_id, page_count):
notification.billable_units = billable_units
dao_update_notification(notification)
current_app.logger.info(
'Letter notification reference {reference}: billable units set to {billable_units}'.format(
reference=str(notification.reference), billable_units=billable_units))
current_app.logger.info(
f"Letter notification id: {notification_id} reference {notification.reference}: "
f"billable units set to {billable_units}"
)
@notify_celery.task(name='collate-letter-pdfs-to-be-sent')