added a check for the field of finished making sure it's not none, and then breaking the DateTime function

This commit is contained in:
Rebeccah 2020-03-04 15:35:04 -05:00
parent 07752f48f6
commit 457dc956f1

View File

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