From 83ecea2377ff0881d27bb34b5d9f7165cf88d6bf Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 21 Jun 2018 09:19:47 -0400 Subject: [PATCH] don't show summary_fields.credential.credential_type_id on /api/v1/ --- awx/api/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 71085911ca..0b3e83ef74 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1964,8 +1964,10 @@ class InventorySourceOptionsSerializer(BaseSerializer): if cred: summary_fields['credential'] = { 'id': cred.id, 'name': cred.name, 'description': cred.description, - 'kind': cred.kind, 'cloud': True, 'credential_type_id': cred.credential_type_id + 'kind': cred.kind, 'cloud': True } + if self.version > 1: + summary_fields['credential']['credential_type_id'] = cred.credential_type_id else: summary_fields.pop('credential') return summary_fields