From 4b34401ca9534cc7cecb858c8c4e80a9196732e6 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 11 Jul 2014 16:39:59 -0400 Subject: [PATCH] Set the host_name on JobHostSummary when the job host summary is saved --- awx/main/models/jobs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index 2936e548a3..f0ca4599c8 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -392,6 +392,8 @@ class JobHostSummary(CreatedModifiedModel): def save(self, *args, **kwargs): # If update_fields has been specified, add our field names to it, # if it hasn't been specified, then we're just doing a normal save. + if self.host is not None: + self.host_name = self.host.name update_fields = kwargs.get('update_fields', []) self.failed = bool(self.dark or self.failures) update_fields.append('failed')