Set the host_name on JobHostSummary when the job host summary is saved

This commit is contained in:
Matthew Jones 2014-07-11 16:39:59 -04:00
parent f93e60979f
commit 4b34401ca9

View File

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