mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 22:46:01 -03:30
Merge pull request #6469 from ryanpetrello/fix-6363
resolve a few CredentialType.inputs validation issues
This commit is contained in:
@@ -1897,11 +1897,14 @@ class CredentialTypeSerializer(BaseSerializer):
|
||||
raise PermissionDenied(
|
||||
detail= _("Modifications to inputs are not allowed for credential types that are in use")
|
||||
)
|
||||
ret = super(CredentialTypeSerializer, self).validate(attrs)
|
||||
|
||||
fields = attrs.get('inputs', {}).get('fields', [])
|
||||
for field in fields:
|
||||
if field.get('ask_at_runtime', False):
|
||||
raise serializers.ValidationError({"inputs": _("'ask_at_runtime' is not supported for custom credentials.")})
|
||||
return super(CredentialTypeSerializer, self).validate(attrs)
|
||||
|
||||
return ret
|
||||
|
||||
def get_related(self, obj):
|
||||
res = super(CredentialTypeSerializer, self).get_related(obj)
|
||||
|
||||
Reference in New Issue
Block a user