diff --git a/seed/data_importer/tasks.py b/seed/data_importer/tasks.py index b10e5f3927..847ab85e90 100644 --- a/seed/data_importer/tasks.py +++ b/seed/data_importer/tasks.py @@ -17,6 +17,7 @@ from bisect import bisect_left from collections import defaultdict, namedtuple from datetime import date, datetime +from datetime import timezone as tz from itertools import chain from math import ceil from typing import Optional, Union @@ -31,7 +32,7 @@ from django.db import DataError, IntegrityError, connection, transaction from django.db.models import Q from django.db.utils import ProgrammingError -from django.utils import timezone as tz +from django.utils import timezone as django_tz from django.utils.timezone import make_naive from seed.building_sync import validation_client @@ -199,7 +200,7 @@ def finish_mapping(import_file_id, mark_as_done, progress_key): value = True setattr(import_record, f"{action}_{state}", value) - import_record.finish_time = tz.now() + import_record.finish_time = django_tz.now() import_record.status = STATUS_READY_TO_MERGE import_record.save() diff --git a/seed/data_importer/tests/integration/test_merge_duplicate_rows.py b/seed/data_importer/tests/integration/test_merge_duplicate_rows.py index 2bfe7c3459..380e40d06e 100644 --- a/seed/data_importer/tests/integration/test_merge_duplicate_rows.py +++ b/seed/data_importer/tests/integration/test_merge_duplicate_rows.py @@ -7,10 +7,10 @@ import logging import os.path as osp import pathlib +from datetime import timezone as tz import pytz from django.core.files.uploadedfile import SimpleUploadedFile -from django.utils import timezone as tz from quantityfield.units import ureg from seed.data_importer import match, tasks diff --git a/seed/tests/test_meter_views.py b/seed/tests/test_meter_views.py index f7b15596a0..c7b4d6eea3 100644 --- a/seed/tests/test_meter_views.py +++ b/seed/tests/test_meter_views.py @@ -7,9 +7,9 @@ import copy import json from datetime import datetime +from datetime import timezone as tz from django.urls import reverse -from django.utils import timezone as tz from seed.data_importer.utils import kbtu_thermal_conversion_factors, kgal_water_conversion_factors from seed.landing.models import SEEDUser as User