mirror of https://github.com/jumpserver/jumpserver
perf: 修改用户序列类 can_public_key_auth 类型; 修改 OPTION 获取字段 id label 为 ID
parent
d2ba7a98ea
commit
d0f70f4316
|
@ -122,6 +122,10 @@ class SimpleMetadataWithFilters(SimpleMetadata):
|
||||||
self.set_tree_field(field, field_info)
|
self.set_tree_field(field, field_info)
|
||||||
elif isinstance(field, serializers.ChoiceField):
|
elif isinstance(field, serializers.ChoiceField):
|
||||||
self.set_choices_field(field, field_info)
|
self.set_choices_field(field, field_info)
|
||||||
|
|
||||||
|
if field.field_name == 'id':
|
||||||
|
field_info['label'] = 'ID'
|
||||||
|
|
||||||
return field_info
|
return field_info
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -83,8 +83,9 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer
|
||||||
)
|
)
|
||||||
login_blocked = serializers.BooleanField(read_only=True, label=_("Login blocked"))
|
login_blocked = serializers.BooleanField(read_only=True, label=_("Login blocked"))
|
||||||
is_expired = serializers.BooleanField(read_only=True, label=_("Is expired"))
|
is_expired = serializers.BooleanField(read_only=True, label=_("Is expired"))
|
||||||
can_public_key_auth = serializers.ReadOnlyField(
|
can_public_key_auth = serializers.BooleanField(
|
||||||
source="can_use_ssh_key_login", label=_("Can public key authentication")
|
source="can_use_ssh_key_login", label=_("Can public key authentication"),
|
||||||
|
read_only=True
|
||||||
)
|
)
|
||||||
password = EncryptedField(
|
password = EncryptedField(
|
||||||
label=_("Password"),
|
label=_("Password"),
|
||||||
|
|
Loading…
Reference in New Issue