diff --git a/awx/api/serializers.py b/awx/api/serializers.py index d505015502..2eeb55cd02 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -73,7 +73,7 @@ SUMMARIZABLE_FK_FIELDS = { 'job_template': DEFAULT_SUMMARY_FIELDS, 'schedule': DEFAULT_SUMMARY_FIELDS + ('next_run',), 'unified_job_template': DEFAULT_SUMMARY_FIELDS + ('unified_job_type',), - 'last_job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'), + 'last_job': DEFAULT_SUMMARY_FIELDS + ('finished', 'status', 'failed', 'license_error'), 'last_job_host_summary': DEFAULT_SUMMARY_FIELDS + ('failed',), 'last_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'), 'current_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'), @@ -757,7 +757,7 @@ class HostSerializer(BaseSerializerWithVariables): pass d['all_groups'] = [{'id': g.id, 'name': g.name} for g in obj.all_groups.all()] d['groups'] = [{'id': g.id, 'name': g.name} for g in obj.groups.all()] - d['recent_jobs'] = [{'id': j.job.id, 'name': j.job.job_template.name, 'status': j.job.status} \ + d['recent_jobs'] = [{'id': j.job.id, 'name': j.job.job_template.name, 'status': j.job.status, 'finished': j.job.finished} \ for j in obj.job_host_summaries.all().order_by('-created')[:5]] return d