diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-06-19 14:35:41 +0100 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-06-19 14:35:41 +0100 |
commit | 376c03c53bc86b88f14ef46c036795eb52186805 (patch) | |
tree | c894e013a91f655b9bfc3307de2a04b557d7aac5 | |
parent | 87e486c73e042646dd441d44ea561e86bd9ba5c0 (diff) | |
download | lorry-controller-376c03c53bc86b88f14ef46c036795eb52186805.tar.gz |
Fix job showerbaserock/richardipsum/fix_job_shower
If our job hasn't ended then our query for (started, ended)
returns the start time and NULL for the end time.
With sqlite3 NULL maps to None.
time.gmtime(None) returns the current time,
so instead of displaying nothing a job that hasn't ended
will display the current time as its ended time.
-rw-r--r-- | lorrycontroller/showjob.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lorrycontroller/showjob.py b/lorrycontroller/showjob.py index 6f73ed6..951ad22 100644 --- a/lorrycontroller/showjob.py +++ b/lorrycontroller/showjob.py @@ -42,7 +42,7 @@ class JobShower(object): 'disk_usage_nice': self.format_bytesize(disk_usage), 'output': output, 'job_started': self.format_time(started), - 'job_ended': self.format_time(ended), + 'job_ended': '' if ended is None else self.format_time(ended), 'timestamp': self.format_time(now), } |