mirror of https://github.com/jumpserver/jumpserver
perf: 优化导入导出
parent
cad6fffd74
commit
12db64ea18
|
@ -81,7 +81,7 @@ class AccountAssetSerializer(serializers.ModelSerializer):
|
|||
|
||||
def to_internal_value(self, data):
|
||||
if isinstance(data, dict):
|
||||
i = data.get('id')
|
||||
i = data.get('id') or data.get('pk')
|
||||
else:
|
||||
i = data
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class AuthValidateMixin(serializers.Serializer):
|
|||
choices=SecretType.choices, required=True, label=_('Secret type')
|
||||
)
|
||||
secret = EncryptedField(
|
||||
label=_('Secret/Password'), required=False, max_length=40960, allow_blank=True,
|
||||
label=_('Secret'), required=False, max_length=40960, allow_blank=True,
|
||||
allow_null=True, write_only=True,
|
||||
)
|
||||
passphrase = serializers.CharField(
|
||||
|
|
|
@ -111,7 +111,7 @@ class BaseFileParser(BaseParser):
|
|||
return {'pk': obj_id, 'name': obj_name}
|
||||
|
||||
def parse_value(self, field, value):
|
||||
if value is '-':
|
||||
if value is '-' and field and field.allow_null:
|
||||
return None
|
||||
elif hasattr(field, 'to_file_internal_value'):
|
||||
value = field.to_file_internal_value(value)
|
||||
|
|
|
@ -584,7 +584,7 @@ msgid "Asset type"
|
|||
msgstr "資産タイプ"
|
||||
|
||||
#: accounts/serializers/account/base.py:19
|
||||
msgid "Secret/Password"
|
||||
msgid "Secret"
|
||||
msgstr "キー/パスワード"
|
||||
|
||||
#: accounts/serializers/account/base.py:24
|
||||
|
|
|
@ -580,8 +580,8 @@ msgid "Asset type"
|
|||
msgstr "资产类型"
|
||||
|
||||
#: accounts/serializers/account/base.py:19
|
||||
msgid "Secret/Password"
|
||||
msgstr "密钥/密码"
|
||||
msgid "Secret"
|
||||
msgstr "密文"
|
||||
|
||||
#: accounts/serializers/account/base.py:24
|
||||
msgid "Key password"
|
||||
|
|
Loading…
Reference in New Issue