fix a bug which caused v1 cred backwards-compat to apply to v2 requests

see: https://github.com/ansible/ansible-tower/issues/7793
This commit is contained in:
Ryan Petrello
2017-11-28 13:05:13 -05:00
parent 7accac2f63
commit 26845642f0
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -2127,7 +2127,7 @@ class CredentialSerializer(BaseSerializer):
def to_internal_value(self, data):
# TODO: remove when API v1 is removed
if 'credential_type' not in data:
if 'credential_type' not in data and self.version == 1:
# If `credential_type` is not provided, assume the payload is a
# v1 credential payload that specifies a `kind` and a flat list
# of field values