fix(assets): 修复网关信息没有密码的bug

pull/6169/head
ibuler 2021-05-21 15:13:43 +08:00 committed by Jiangjie.Bai
parent 9ccde03656
commit d765e61991
1 changed files with 7 additions and 7 deletions

View File

@ -59,7 +59,7 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
'created_by', 'comment',
]
fields_fk = ['domain']
fields = fields_small + fields_fk
fields = fields_small + fields_fk
extra_kwargs = {
'password': {'write_only': True, 'validators': [NoSpecialChars()]},
'private_key': {"write_only": True},
@ -78,12 +78,12 @@ class GatewaySerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
class GatewayWithAuthSerializer(GatewaySerializer):
def get_field_names(self, declared_fields, info):
fields = super().get_field_names(declared_fields, info)
fields.extend(
['password', 'private_key']
)
return fields
class Meta(GatewaySerializer.Meta):
extra_kwargs = {
'password': {'write_only': False, 'validators': [NoSpecialChars()]},
'private_key': {"write_only": False},
'public_key': {"write_only": False},
}
class DomainWithGatewaySerializer(BulkOrgResourceModelSerializer):