mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Prevent edit of vault ID once credential is created and added check to ensure user is actually trying to change vault id.
This commit is contained in:
parent
6a63af83c0
commit
f6fb46d99e
@ -2664,6 +2664,13 @@ class CredentialSerializer(BaseSerializer):
|
||||
|
||||
return credential_type
|
||||
|
||||
def validate_inputs(self, inputs):
|
||||
if self.instance and self.instance.credential_type.kind == "vault":
|
||||
if 'vault_id' in inputs and inputs['vault_id'] != self.instance.inputs['vault_id']:
|
||||
raise ValidationError(_('We do not permit Vault IDs to be changed after they have been created.'))
|
||||
|
||||
return inputs
|
||||
|
||||
|
||||
class CredentialSerializerCreate(CredentialSerializer):
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user