mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Fix issue AC-977 by including job_template in summary fields for job
activity stream events
This commit is contained in:
@@ -1207,7 +1207,18 @@ class ActivityStreamSerializer(BaseSerializer):
|
|||||||
allm2m = getattr(obj, fk).all()
|
allm2m = getattr(obj, fk).all()
|
||||||
if allm2m.count() > 0:
|
if allm2m.count() > 0:
|
||||||
summary_fields[fk] = []
|
summary_fields[fk] = []
|
||||||
|
summary_fields['job_template'] = []
|
||||||
for thisItem in allm2m:
|
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 = {}
|
thisItemDict = {}
|
||||||
if 'id' not in related_fields:
|
if 'id' not in related_fields:
|
||||||
related_fields = related_fields + ('id',)
|
related_fields = related_fields + ('id',)
|
||||||
|
|||||||
Reference in New Issue
Block a user