From 8708fcf8ce605baa2c4982c2793f53bc81a01481 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 1 Jun 2016 15:02:09 -0400 Subject: [PATCH] Handle corner case when a job spawns notifications If a dependent task fails a job might not have a started or finished time when emitting the notification --- awx/main/models/unified_jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 752dbff5a6..766db6718e 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -754,8 +754,8 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique name=self.name, url=self.get_ui_url(), created_by=smart_text(self.created_by), - started=self.started.isoformat(), - finished=self.finished.isoformat(), + started=self.started.isoformat() if self.started is not None else None, + finished=self.finished.isoformat() if self.finished is not None else None, status=self.status, traceback=self.result_traceback)