mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-18 21:44:41 -04:00
put pdfs in tomorrow's dvla bucket after 17:30
So if someone sends a letter in the evening, it gets picked up the next day
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, time
|
||||
|
||||
from flask import current_app
|
||||
|
||||
@@ -83,8 +83,13 @@ def remove_transformed_dvla_file(job_id):
|
||||
|
||||
def upload_letters_pdf(reference, crown, filedata):
|
||||
now = datetime.utcnow()
|
||||
|
||||
print_datetime = now
|
||||
if now.time() > time(17, 30):
|
||||
print_datetime = now + timedelta(days=1)
|
||||
|
||||
upload_file_name = LETTERS_PDF_FILE_LOCATION_STRUCTURE.format(
|
||||
folder=now.date().isoformat(),
|
||||
folder=print_datetime.date(),
|
||||
reference=reference,
|
||||
duplex="D",
|
||||
letter_class="2",
|
||||
|
||||
Reference in New Issue
Block a user