diff --git a/app/models/job.py b/app/models/job.py index 9c987a44c..5ff3f4f82 100644 --- a/app/models/job.py +++ b/app/models/job.py @@ -67,7 +67,7 @@ class Job(JSONModel): def processing_started(self): if not self._dict.get('processing_started'): return None - return utc_string_to_aware_gmt_datetime(self._dict['processing_started']) + return self._dict['processing_started'] def _aggregate_statistics(self, *statuses): return sum( @@ -124,7 +124,9 @@ class Job(JSONModel): # notifications yet return True return ( - datetime.utcnow().astimezone(local_timezone) - self.processing_started + datetime.utcnow().astimezone(local_timezone) - utc_string_to_aware_gmt_datetime( + self.processing_started + ) ).days < 1 @property diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index fc12fa040..8e5a02634 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -706,7 +706,7 @@ def test_should_show_updates_for_scheduled_job_as_json( assert 'Status' in content['notifications'] assert 'Delivered' in content['notifications'] assert '12:01am' in content['notifications'] - assert 'Sent by Test User on 1 June at 5:00pm' in content['status'] + assert 'Sent by Test User on 1 June at 4:00pm' in content['status'] @pytest.mark.parametrize(