mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-26 10:21:09 -04:00
Fix incorrect processing started time on jobs
We were doing the UTC to BST conversion twice, meaning the job was shown as being started 2 hours later than UTC, and 1 hour later than actual BST.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user