Moved log message inside the if statement where it actually happens.

This caught me out the other day when I was testing. I thought antivirus
was enable, seeing this message didn't help with that assumption. Plus
there is no point in showing the log if we don't actually call the task.
This commit is contained in:
Rebecca Law
2022-01-27 15:05:07 +00:00
parent df28f253fa
commit 8bf245f63a

View File

@@ -429,10 +429,9 @@ def process_precompiled_letter_notifications(*, letter_data, api_key, service, t
'postage': notification.postage 'postage': notification.postage
} }
current_app.logger.info('Calling task scan-file for {}'.format(filename))
# call task to add the filename to anti virus queue # call task to add the filename to anti virus queue
if current_app.config['ANTIVIRUS_ENABLED']: if current_app.config['ANTIVIRUS_ENABLED']:
current_app.logger.info('Calling task scan-file for {}'.format(filename))
notify_celery.send_task( notify_celery.send_task(
name=TaskNames.SCAN_FILE, name=TaskNames.SCAN_FILE,
kwargs={'filename': filename}, kwargs={'filename': filename},