mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
Fix up a bug in the unit test from fixing the job template assumption
This commit is contained in:
parent
9b1982a2e5
commit
95ba711fc1
@ -756,11 +756,7 @@ class HostSerializer(BaseSerializerWithVariables):
|
||||
d['last_job']['job_template_name'] = obj.last_job.job_template.name
|
||||
except (KeyError, AttributeError):
|
||||
pass
|
||||
if j.job.job_template is not None:
|
||||
job_template_name = j.job.job_template.name
|
||||
else:
|
||||
job_template_name = ""
|
||||
d.update({'recent_jobs': [{'id': j.job.id, 'name': job_template_name, 'status': j.job.status,
|
||||
d.update({'recent_jobs': [{'id': j.job.id, 'name': j.job.job_template.name if j.job.job_template is not None else "", 'status': j.job.status,
|
||||
'finished': j.job.finished} for j in obj.job_host_summaries.all().order_by('-created')[:5]]})
|
||||
return d
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user