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:
Chris Hill-Scott
2020-09-28 14:53:42 +01:00
parent 65e32f8e5a
commit 86ec9430a2
2 changed files with 5 additions and 3 deletions

View File

@@ -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