Merge pull request #6968 from ryanpetrello/fix-6959

fix a few issues in credential type kind validation
This commit is contained in:
Ryan Petrello
2017-07-11 13:30:07 -04:00
committed by GitHub
3 changed files with 35 additions and 3 deletions

View File

@@ -1904,9 +1904,9 @@ class CredentialTypeSerializer(BaseSerializer):
)
ret = super(CredentialTypeSerializer, self).validate(attrs)
if 'kind' in attrs and attrs['kind'] not in ('cloud', 'network'):
if 'kind' in attrs and attrs['kind'] not in ('cloud', 'net'):
raise serializers.ValidationError({
"kind": _("Must be 'cloud' or 'network', not %s") % attrs['kind']
"kind": _("Must be 'cloud' or 'net', not %s") % attrs['kind']
})
fields = attrs.get('inputs', {}).get('fields', [])