diff --git a/app/celery/nightly_tasks.py b/app/celery/nightly_tasks.py index b561fa1bb..5437422c0 100644 --- a/app/celery/nightly_tasks.py +++ b/app/celery/nightly_tasks.py @@ -100,7 +100,9 @@ def _delete_notifications_older_than_retention_by_type(notification_type): 'datetime_to_delete_before': day_to_delete_backwards_from }) - seven_days_ago = get_local_midnight_in_utc(convert_utc_to_local_timezone(datetime.utcnow()).date() - timedelta(days=7)) + seven_days_ago = get_local_midnight_in_utc( + convert_utc_to_local_timezone(datetime.utcnow()).date() - timedelta(days=7) + ) service_ids_with_data_retention = {x.service_id for x in flexible_data_retention} # get a list of all service ids that we'll need to delete for. Typically that might only be 5% of services. diff --git a/app/dao/date_util.py b/app/dao/date_util.py index 08fa4186a..94d6cb3cb 100644 --- a/app/dao/date_util.py +++ b/app/dao/date_util.py @@ -1,11 +1,10 @@ from datetime import date, datetime, time, timedelta -from os import getenv import pytz from notifications_utils.timezones import ( convert_local_timezone_to_utc, convert_utc_to_local_timezone, - local_timezone + local_timezone, ) diff --git a/app/utils.py b/app/utils.py index c483cbe76..883eff9ce 100644 --- a/app/utils.py +++ b/app/utils.py @@ -1,14 +1,13 @@ from datetime import datetime, timedelta from os import getenv -import pytz from flask import url_for from notifications_utils.template import ( HTMLEmailTemplate, LetterPrintTemplate, SMSMessageTemplate, ) -from notifications_utils.timezones import convert_local_timezone_to_utc, local_timezone +from notifications_utils.timezones import convert_local_timezone_to_utc from sqlalchemy import func DATETIME_FORMAT_NO_TIMEZONE = "%Y-%m-%d %H:%M:%S.%f"