mirror of
https://github.com/ansible/awx.git
synced 2026-02-14 01:34:45 -03:30
Fix job template job sorting
"started" isn't a good field to sort on as it can be Null. "created" will always be available.
This commit is contained in:
@@ -1505,7 +1505,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer):
|
|||||||
else:
|
else:
|
||||||
d['can_copy'] = False
|
d['can_copy'] = False
|
||||||
d['can_edit'] = False
|
d['can_edit'] = False
|
||||||
d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-started')[:10]]
|
d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]]
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def validate_survey_enabled(self, attrs, source):
|
def validate_survey_enabled(self, attrs, source):
|
||||||
|
|||||||
Reference in New Issue
Block a user