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