mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-24 14:02:01 +00:00
perf: change secret ignore secret type
This commit is contained in:
parent
94526e44f1
commit
f39a3a34e4
@ -42,6 +42,19 @@ class ChangeSecretAutomationSerializer(AuthValidateMixin, BaseAutomationSerializ
|
|||||||
)},
|
)},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.set_secret_type_choices()
|
||||||
|
|
||||||
|
def set_secret_type_choices(self):
|
||||||
|
secret_type = self.fields.get('secret_type')
|
||||||
|
if not secret_type:
|
||||||
|
return
|
||||||
|
choices = secret_type._choices
|
||||||
|
choices.pop(SecretType.ACCESS_KEY, None)
|
||||||
|
choices.pop(SecretType.TOKEN, None)
|
||||||
|
secret_type._choices = choices
|
||||||
|
|
||||||
def validate_password_rules(self, password_rules):
|
def validate_password_rules(self, password_rules):
|
||||||
secret_type = self.initial_secret_type
|
secret_type = self.initial_secret_type
|
||||||
if secret_type != SecretType.PASSWORD:
|
if secret_type != SecretType.PASSWORD:
|
||||||
|
Loading…
Reference in New Issue
Block a user