diff --git a/apps/common/drf/metadata.py b/apps/common/drf/metadata.py index fc9ceb961..52c89ba43 100644 --- a/apps/common/drf/metadata.py +++ b/apps/common/drf/metadata.py @@ -122,6 +122,10 @@ class SimpleMetadataWithFilters(SimpleMetadata): self.set_tree_field(field, field_info) elif isinstance(field, serializers.ChoiceField): self.set_choices_field(field, field_info) + + if field.field_name == 'id': + field_info['label'] = 'ID' + return field_info @staticmethod diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index be083a322..b872f4bd0 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -83,8 +83,9 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer ) login_blocked = serializers.BooleanField(read_only=True, label=_("Login blocked")) is_expired = serializers.BooleanField(read_only=True, label=_("Is expired")) - can_public_key_auth = serializers.ReadOnlyField( - source="can_use_ssh_key_login", label=_("Can public key authentication") + can_public_key_auth = serializers.BooleanField( + source="can_use_ssh_key_login", label=_("Can public key authentication"), + read_only=True ) password = EncryptedField( label=_("Password"),