mirror of https://github.com/jumpserver/jumpserver
fix(assets): 修复网关信息没有密码的bug
parent
9ccde03656
commit
d765e61991
|
@ -59,7 +59,7 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
|
||||||
'created_by', 'comment',
|
'created_by', 'comment',
|
||||||
]
|
]
|
||||||
fields_fk = ['domain']
|
fields_fk = ['domain']
|
||||||
fields = fields_small + fields_fk
|
fields = fields_small + fields_fk
|
||||||
extra_kwargs = {
|
extra_kwargs = {
|
||||||
'password': {'write_only': True, 'validators': [NoSpecialChars()]},
|
'password': {'write_only': True, 'validators': [NoSpecialChars()]},
|
||||||
'private_key': {"write_only": True},
|
'private_key': {"write_only": True},
|
||||||
|
@ -78,12 +78,12 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
|
||||||
|
|
||||||
|
|
||||||
class GatewayWithAuthSerializer(GatewaySerializer):
|
class GatewayWithAuthSerializer(GatewaySerializer):
|
||||||
def get_field_names(self, declared_fields, info):
|
class Meta(GatewaySerializer.Meta):
|
||||||
fields = super().get_field_names(declared_fields, info)
|
extra_kwargs = {
|
||||||
fields.extend(
|
'password': {'write_only': False, 'validators': [NoSpecialChars()]},
|
||||||
['password', 'private_key']
|
'private_key': {"write_only": False},
|
||||||
)
|
'public_key': {"write_only": False},
|
||||||
return fields
|
}
|
||||||
|
|
||||||
|
|
||||||
class DomainWithGatewaySerializer(BulkOrgResourceModelSerializer):
|
class DomainWithGatewaySerializer(BulkOrgResourceModelSerializer):
|
||||||
|
|
Loading…
Reference in New Issue