mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Fix up a bug in the unit test from fixing the job template assumption
This commit is contained in:
@@ -756,11 +756,7 @@ class HostSerializer(BaseSerializerWithVariables):
|
|||||||
d['last_job']['job_template_name'] = obj.last_job.job_template.name
|
d['last_job']['job_template_name'] = obj.last_job.job_template.name
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
pass
|
pass
|
||||||
if j.job.job_template is not None:
|
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,
|
||||||
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,
|
|
||||||
'finished': j.job.finished} for j in obj.job_host_summaries.all().order_by('-created')[:5]]})
|
'finished': j.job.finished} for j in obj.job_host_summaries.all().order_by('-created')[:5]]})
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user