mirror of https://github.com/jumpserver/jumpserver
fix: 修改 修改ssh密钥时报500问题
parent
0b16d70c0c
commit
69d4a0a250
|
@ -43,6 +43,7 @@ class AuthSerializerMixin(serializers.ModelSerializer):
|
||||||
if not private_key:
|
if not private_key:
|
||||||
return
|
return
|
||||||
passphrase = self.initial_data.get('passphrase')
|
passphrase = self.initial_data.get('passphrase')
|
||||||
|
passphrase = passphrase if passphrase else None
|
||||||
valid = validate_ssh_private_key(private_key, password=passphrase)
|
valid = validate_ssh_private_key(private_key, password=passphrase)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise serializers.ValidationError(_("private key invalid or passphrase error"))
|
raise serializers.ValidationError(_("private key invalid or passphrase error"))
|
||||||
|
|
Loading…
Reference in New Issue