mirror of
https://github.com/ansible/awx.git
synced 2026-03-17 08:57:33 -02:30
Switched /api/v1/roles/ to a cursor paginator so we don't have to do a count() on that potentially very large result set
This commit is contained in:
@@ -38,6 +38,7 @@ from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.settings import api_settings
|
||||
from rest_framework.views import exception_handler
|
||||
from rest_framework.pagination import CursorPagination
|
||||
from rest_framework import status
|
||||
|
||||
# Django REST Framework YAML
|
||||
@@ -3475,6 +3476,9 @@ class RoleList(ListAPIView):
|
||||
model = Role
|
||||
serializer_class = RoleSerializer
|
||||
permission_classes = (IsAuthenticated,)
|
||||
class CursorPaginationById(CursorPagination):
|
||||
ordering = 'id'
|
||||
pagination_class = CursorPaginationById
|
||||
new_in_300 = True
|
||||
|
||||
def get_queryset(self):
|
||||
|
||||
Reference in New Issue
Block a user