mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
Fix issue AC-977 by including job_template in summary fields for job
activity stream events
This commit is contained in:
parent
6a3e477c9a
commit
e4d860e3dc
@ -1207,7 +1207,18 @@ class ActivityStreamSerializer(BaseSerializer):
|
||||
allm2m = getattr(obj, fk).all()
|
||||
if allm2m.count() > 0:
|
||||
summary_fields[fk] = []
|
||||
summary_fields['job_template'] = []
|
||||
for thisItem in allm2m:
|
||||
if fk == 'job':
|
||||
job_template_item = {}
|
||||
job_template_fields = SUMMARIZABLE_FK_FIELDS['job_template']
|
||||
job_template = getattr(thisItem, 'job_template', None)
|
||||
if job_template is not None:
|
||||
for field in job_template_fields:
|
||||
fval = getattr(job_template, field, None)
|
||||
if fval is not None:
|
||||
job_template_item[field] = fval
|
||||
summary_fields['job_template'].append(job_template_item)
|
||||
thisItemDict = {}
|
||||
if 'id' not in related_fields:
|
||||
related_fields = related_fields + ('id',)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user