Reserved task don't have a start_time attribute, return None instead.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-06-23 14:32:20 -04:00
parent f39fde8b4b
commit d4d0b7129b

View File

@@ -40,7 +40,11 @@ class Task(object):
return force_text(self.task_type)
def get_time_started(self):
return now() - timedelta(seconds=monotonic() - self.kwargs['time_start'])
time_start = self.kwargs.get('time_start')
if time_start:
return now() - timedelta(seconds=monotonic() - self.kwargs['time_start'])
else:
return None
@python_2_unicode_compatible