1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Filter out inactive jobs when pulling for latest status on the job

template list
This commit is contained in:
Matthew Jones 2015-03-26 10:22:05 -04:00
parent 4129282401
commit e790ba480e

View File

@ -1361,7 +1361,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer):
else:
d['can_copy'] = False
d['can_edit'] = False
d['recent_jobs'] = [{'id': x.id, 'status': x.status} for x in obj.jobs.all().order_by('-started')[:10]]
d['recent_jobs'] = [{'id': x.id, 'status': x.status} for x in obj.jobs.filter(active=True).order_by('-started')[:10]]
return d
class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):