mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 12:10:06 -03:30
require project field for openstack credential
This commit is contained in:
@@ -215,6 +215,12 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
|
|||||||
raise ValidationError('Password required for VMware credential.')
|
raise ValidationError('Password required for VMware credential.')
|
||||||
return password
|
return password
|
||||||
|
|
||||||
|
def clean_project(self):
|
||||||
|
project = self.project or ''
|
||||||
|
if self.kind == 'openstack' and not project:
|
||||||
|
raise ValidationError('Project name required for OpenStack credential.')
|
||||||
|
return project
|
||||||
|
|
||||||
def _validate_ssh_private_key(self, data):
|
def _validate_ssh_private_key(self, data):
|
||||||
"""Validate that the given SSH private key or certificate is,
|
"""Validate that the given SSH private key or certificate is,
|
||||||
in fact, valid.
|
in fact, valid.
|
||||||
|
|||||||
Reference in New Issue
Block a user