separate batch num from date

DVLA don't care about the naming conventions of zip files, other than
it must start with `NOTIFY.` and end with `.ZIP`. So lets format the
date in a more readable way, and separate it from the batch number
This commit is contained in:
Leo Hemsted
2019-03-20 12:15:25 +00:00
parent 1a4baf4283
commit 334eb473ed
2 changed files with 4 additions and 3 deletions

View File

@@ -120,7 +120,8 @@ def collate_letter_pdfs_for_day(date=None):
subfolder=date
)
for i, letters in enumerate(group_letters(letter_pdfs)):
dvla_filename = 'NOTIFY.{date}{num:06}.ZIP'.format(date=date.replace('-', ''), num=i + 1)
# eg NOTIFY.2018-12-31.001.ZIP
dvla_filename = 'NOTIFY.{date}.{num:03}.ZIP'.format(date=date, num=i + 1)
filenames = [letter['Key'] for letter in letters]
current_app.logger.info(
'Calling task zip-and-send-letter-pdfs for {} pdfs to upload {} with total size {:,} bytes'.format(