mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
Set the host_name on JobHostSummary when the job host summary is saved
This commit is contained in:
@@ -392,6 +392,8 @@ class JobHostSummary(CreatedModifiedModel):
|
|||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
# If update_fields has been specified, add our field names to it,
|
# 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 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', [])
|
update_fields = kwargs.get('update_fields', [])
|
||||||
self.failed = bool(self.dark or self.failures)
|
self.failed = bool(self.dark or self.failures)
|
||||||
update_fields.append('failed')
|
update_fields.append('failed')
|
||||||
|
|||||||
Reference in New Issue
Block a user