From fed0732c1ed842e05e8280dd94c024040121a6ea Mon Sep 17 00:00:00 2001 From: huangzhiwen Date: Tue, 19 Jul 2022 17:28:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B5=84=E4=BA=A7=E5=88=97=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E4=B8=8D=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/asset/user_permission/user_permission_assets/mixin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/perms/api/asset/user_permission/user_permission_assets/mixin.py b/apps/perms/api/asset/user_permission/user_permission_assets/mixin.py index 1b6b8e00f..ef0c8964a 100644 --- a/apps/perms/api/asset/user_permission/user_permission_assets/mixin.py +++ b/apps/perms/api/asset/user_permission/user_permission_assets/mixin.py @@ -33,7 +33,9 @@ class UserAllGrantedAssetsQuerysetMixin: only_fields = serializers.AssetGrantedSerializer.Meta.only_fields pagination_class = AllGrantedAssetPagination user: User - + ordering_fields = ("hostname", "ip", "port", "cpu_cores") + ordering = ('hostname', ) + def get_queryset(self): if getattr(self, 'swagger_fake_view', False): return Asset.objects.none()