mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 14:11:24 -03:30
Merge pull request #298 from jangsutsr/7479_prevent_accessing_none_attr_in_host_summary_repr
Prevent accessing None attributes in host summary __unicode__
This commit is contained in:
commit
1df3432130
@ -830,8 +830,9 @@ class JobHostSummary(CreatedModifiedModel):
|
||||
failed = models.BooleanField(default=False, editable=False)
|
||||
|
||||
def __unicode__(self):
|
||||
hostname = self.host.name if self.host else 'N/A'
|
||||
return '%s changed=%d dark=%d failures=%d ok=%d processed=%d skipped=%s' % \
|
||||
(self.host.name, self.changed, self.dark, self.failures, self.ok,
|
||||
(hostname, self.changed, self.dark, self.failures, self.ok,
|
||||
self.processed, self.skipped)
|
||||
|
||||
def get_absolute_url(self, request=None):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user