mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Merge pull request #2922 from wwitzel3/issue-2508
ensure CustomInventoryScripts render correctly in the ActivityStream
This commit is contained in:
commit
f9707c0ca1
@ -87,6 +87,7 @@ SUMMARIZABLE_FK_FIELDS = {
|
||||
'current_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
|
||||
'current_job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
|
||||
'inventory_source': ('source', 'last_updated', 'status'),
|
||||
'custom_inventory_script': DEFAULT_SUMMARY_FIELDS,
|
||||
'source_script': ('name', 'description'),
|
||||
'role': ('id', 'role_field'),
|
||||
'notification_template': DEFAULT_SUMMARY_FIELDS,
|
||||
@ -2620,7 +2621,11 @@ class ActivityStreamSerializer(BaseSerializer):
|
||||
if getattr(obj, fk).exists():
|
||||
rel[fk] = []
|
||||
for thisItem in allm2m:
|
||||
rel[fk].append(reverse('api:' + fk + '_detail', args=(thisItem.id,)))
|
||||
if fk == 'custom_inventory_script':
|
||||
rel[fk].append(reverse('api:inventory_script_detail', args=(thisItem.id,)))
|
||||
else:
|
||||
rel[fk].append(reverse('api:' + fk + '_detail', args=(thisItem.id,)))
|
||||
|
||||
if fk == 'schedule':
|
||||
rel['unified_job_template'] = thisItem.unified_job_template.get_absolute_url()
|
||||
return rel
|
||||
|
||||
@ -323,6 +323,7 @@ model_serializer_mapping = {
|
||||
Host: HostSerializer,
|
||||
Group: GroupSerializer,
|
||||
InventorySource: InventorySourceSerializer,
|
||||
CustomInventoryScript: CustomInventoryScriptSerializer,
|
||||
Credential: CredentialSerializer,
|
||||
Team: TeamSerializer,
|
||||
Project: ProjectSerializer,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user