fix - search in page & permissions
This commit is contained in:
@@ -63,7 +63,7 @@ class PageViewSet(SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
def list(self, request, *args, **kwargs):
|
||||
""" all pages """
|
||||
|
||||
page = self.paginate_queryset(self.queryset.order_by('-create_date'))
|
||||
page = self.paginate_queryset(self.filter_queryset(self.queryset.order_by('-modify_date')))
|
||||
if page is not None: # noqa
|
||||
serializer = self.get_serializer(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
@@ -97,7 +97,7 @@ class PermissionViewSet(SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
search_fields = ['page__name', ]
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
queryset = self.filter_queryset(self.get_queryset().order_by('-create_date')) # noqa
|
||||
queryset = self.filter_queryset(self.get_queryset().order_by('-modify_date')) # noqa
|
||||
|
||||
page = self.paginate_queryset(queryset)
|
||||
if page is not None:
|
||||
@@ -133,7 +133,7 @@ class PermissionViewSet(SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
role_num=Count('role'),
|
||||
).filter(user_relation_num=0, role_num=0) # noqa
|
||||
|
||||
page = self.paginate_queryset(permissions)
|
||||
page = self.paginate_queryset(self.filter_queryset(permissions))
|
||||
if page is not None:
|
||||
serializer = self.get_serializer(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
|
||||
Reference in New Issue
Block a user