From 457dc956f12ce1575b365f841bb15f5e7af7cbfc Mon Sep 17 00:00:00 2001 From: Rebeccah Date: Wed, 4 Mar 2020 15:35:04 -0500 Subject: [PATCH] added a check for the field of finished making sure it's not none, and then breaking the DateTime function --- awx/main/models/unified_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 168f28a25a..1b17291fba 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -1219,7 +1219,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique status_data['instance_group_name'] = self.instance_group.name else: status_data['instance_group_name'] = None - elif status in ['successful', 'failed', 'canceled']: + elif status in ['successful', 'failed', 'canceled'] and self.finished: status_data['finished'] = datetime.datetime.strftime(self.finished, "%Y-%m-%dT%H:%M:%S.%fZ") status_data.update(self.websocket_emit_data()) status_data['group_name'] = 'jobs'