Update callback handling to process DVLA response files

- handle `RS.TXT` and `RSP.TXT` files
This commit is contained in:
Ken Tsang
2018-01-15 14:09:46 +00:00
committed by Katie Smith
parent 9629a69353
commit 6a3c2734ca
2 changed files with 32 additions and 22 deletions

View File

@@ -54,7 +54,8 @@ def process_letter_response():
filename = message['Records'][0]['s3']['object']['key']
current_app.logger.info('Received file from DVLA: {}'.format(filename))
if 'rs.txt' in filename.lower():
if filename.lower().endswith('rs.txt') or filename.lower().endswith('rsp.txt'):
current_app.logger.info('DVLA callback: Calling task to update letter notifications')
update_letter_notifications_statuses.apply_async([filename], queue=QueueNames.NOTIFY)
return jsonify(