mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 19:07:39 -02:30
Merge pull request #7240 from ryanpetrello/fix-7216
improve sanitation of empty credential values to match API v1 behavior
This commit is contained in:
@@ -457,6 +457,13 @@ class CredentialType(CommonModelNameNotUnique):
|
||||
if field.get('ask_at_runtime', False) is True
|
||||
]
|
||||
|
||||
def default_for_field(self, field_id):
|
||||
for field in self.inputs.get('fields', []):
|
||||
if field['id'] == field_id:
|
||||
if 'choices' in field:
|
||||
return field['choices'][0]
|
||||
return {'string': '', 'boolean': False}[field['type']]
|
||||
|
||||
@classmethod
|
||||
def default(cls, f):
|
||||
func = functools.partial(f, cls)
|
||||
|
||||
Reference in New Issue
Block a user