mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
refactor the job type name into a single property
This commit is contained in:
@@ -1697,7 +1697,7 @@ class HostSerializer(BaseSerializerWithVariables):
|
||||
d.setdefault('recent_jobs', [{
|
||||
'id': j.job.id,
|
||||
'name': j.job.job_template.name if j.job.job_template is not None else "",
|
||||
'type': j.job.get_real_instance_class()._meta.verbose_name.replace(' ', '_'),
|
||||
'type': j.job.job_type_name,
|
||||
'status': j.job.status,
|
||||
'finished': j.job.finished,
|
||||
} for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created')[:5]])
|
||||
@@ -2842,7 +2842,7 @@ class JobTemplateMixin(object):
|
||||
return [{
|
||||
'id': x.id, 'status': x.status, 'finished': x.finished, 'canceled_on': x.canceled_on,
|
||||
# Make type consistent with API top-level key, for instance workflow_job
|
||||
'type': x.get_real_instance_class()._meta.verbose_name.replace(' ', '_')
|
||||
'type': x.job_type_name
|
||||
} for x in optimized_qs[:10]]
|
||||
|
||||
def get_summary_fields(self, obj):
|
||||
|
||||
Reference in New Issue
Block a user