mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 20:07:37 -02:30
Add ids to summary fields and actor for AC-673
This commit is contained in:
@@ -1053,6 +1053,8 @@ class ActivityStreamSerializer(BaseSerializer):
|
|||||||
summary_fields[fk] = []
|
summary_fields[fk] = []
|
||||||
for thisItem in allm2m:
|
for thisItem in allm2m:
|
||||||
thisItemDict = {}
|
thisItemDict = {}
|
||||||
|
if 'id' not in related_fields:
|
||||||
|
related_fields = related_fields + ('id',)
|
||||||
for field in related_fields:
|
for field in related_fields:
|
||||||
fval = getattr(thisItem, field, None)
|
fval = getattr(thisItem, field, None)
|
||||||
if fval is not None:
|
if fval is not None:
|
||||||
@@ -1061,7 +1063,8 @@ class ActivityStreamSerializer(BaseSerializer):
|
|||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
pass
|
pass
|
||||||
if obj.actor is not None:
|
if obj.actor is not None:
|
||||||
summary_fields['actor'] = dict(username = obj.actor.username,
|
summary_fields['actor'] = dict(id = obj.actor.id,
|
||||||
|
username = obj.actor.username,
|
||||||
first_name = obj.actor.first_name,
|
first_name = obj.actor.first_name,
|
||||||
last_name = obj.actor.last_name)
|
last_name = obj.actor.last_name)
|
||||||
return summary_fields
|
return summary_fields
|
||||||
|
|||||||
Reference in New Issue
Block a user