Merge pull request #8625 from jumpserver/pr@dev@fix_perms_asset-user-permission

fix: 管理员与用户资产列表排序不统一
pull/8626/head
吴小白 2022-07-19 18:06:40 +08:00 committed by GitHub
commit bdf59da0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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()