fix letters being put in the wrong bucket when near midnight cut-off

another day, another timezone bug
This commit is contained in:
Leo Hemsted
2018-07-02 14:16:40 +01:00
parent 69c01ce8a0
commit cb7f5a7166
2 changed files with 11 additions and 3 deletions

View File

@@ -26,9 +26,9 @@ def get_folder_name(_now, is_test_or_scan_letter=False):
if is_test_or_scan_letter:
folder_name = ''
else:
print_datetime = _now
if convert_utc_to_bst(_now).time() > current_app.config.get('LETTER_PROCESSING_DEADLINE'):
print_datetime = _now + timedelta(days=1)
print_datetime = convert_utc_to_bst(_now)
if print_datetime.time() > current_app.config.get('LETTER_PROCESSING_DEADLINE'):
print_datetime += timedelta(days=1)
folder_name = '{}/'.format(print_datetime.date())
return folder_name