Attempt to infer related pages on export when the link is missing

This commit is contained in:
Jeff Bradberry
2020-10-08 11:23:17 -04:00
parent 32c08a09c3
commit a07dabae9e
3 changed files with 16 additions and 26 deletions

View File

@@ -3438,10 +3438,10 @@ class WorkflowJobTemplateSerializer(JobTemplateMixin, LabelsListMixin, UnifiedJo
res['organization'] = self.reverse('api:organization_detail', kwargs={'pk': obj.organization.pk})
if obj.webhook_credential_id:
res['webhook_credential'] = self.reverse('api:credential_detail', kwargs={'pk': obj.webhook_credential_id})
if obj.inventory:
if obj.inventory_id:
res['inventory'] = self.reverse(
'api:inventory_detail', kwargs={
'pk': obj.inventory.pk
'pk': obj.inventory_id
}
)
return res