Fix up a bug in the unit test from fixing the job template assumption

This commit is contained in:
Matthew Jones 2014-06-23 14:13:30 -04:00
parent 9b1982a2e5
commit 95ba711fc1

View File

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