Skip to content

Commit

Permalink
fix(assets): 修复网关信息没有密码的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler authored and BaiJiangJie committed May 21, 2021
1 parent 162e5b2 commit 344c291
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apps/assets/serializers/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Meta:
'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},
Expand All @@ -78,12 +78,12 @@ def protocol_limit_to_ssh(self):


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):
Expand Down

0 comments on commit 344c291

Please sign in to comment.