fix: 用户接口不分页时,api异常

pull/9551/head
jiangweidong 2023-02-14 18:12:16 +08:00 committed by Jiangjie.Bai
parent ac4a321225
commit 7d93c9ebc5
1 changed files with 3 additions and 2 deletions

View File

@ -53,8 +53,9 @@ class UserViewSet(CommonApiMixin, UserQuerysetMixin, SuggestionMixin, BulkModelV
return queryset
def paginate_queryset(self, queryset):
queryset = super().paginate_queryset(queryset) or queryset
return self.set_users_roles_for_cache(queryset)
page = super().paginate_queryset(queryset)
self.set_users_roles_for_cache(page or queryset)
return page
@action(methods=['get'], detail=False, url_path='suggestions')
def match(self, request, *args, **kwargs):