mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Change format of the letter response file we expect
We were previously expecting the letter response files to be in the format of 'NOTIFY.<datetime>.RSP.TXT' but the response files we receive use '-' in the filenames instead of '.' which was causing an error when we tried to get the date from the filename.
This commit is contained in:
@@ -123,7 +123,7 @@ def firetext_callback(notification_id, to):
|
||||
def create_fake_letter_response_file(self, reference):
|
||||
now = datetime.utcnow()
|
||||
dvla_response_data = '{}|Sent|0|Sorted'.format(reference)
|
||||
upload_file_name = 'NOTIFY.{}.RSP.TXT'.format(now.strftime('%Y%m%d%H%M%S'))
|
||||
upload_file_name = 'NOTIFY-{}-RSP.TXT'.format(now.strftime('%Y%m%d%H%M%S'))
|
||||
|
||||
s3upload(
|
||||
filedata=dvla_response_data,
|
||||
|
||||
@@ -440,7 +440,7 @@ def update_letter_notifications_statuses(self, filename):
|
||||
|
||||
|
||||
def get_billing_date_in_bst_from_filename(filename):
|
||||
datetime_string = filename.split('.')[1]
|
||||
datetime_string = filename.split('-')[1]
|
||||
datetime_obj = datetime.strptime(datetime_string, '%Y%m%d%H%M%S')
|
||||
return convert_utc_to_bst(datetime_obj).date()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user