Increased the page size for the entitlements API
This commit is contained in:
@@ -17,12 +17,21 @@ from entitlements.models import CourseEntitlement
|
||||
from entitlements.signals import REFUND_ENTITLEMENT
|
||||
from openedx.core.djangoapps.catalog.utils import get_course_runs_for_course
|
||||
from openedx.core.djangoapps.cors_csrf.authentication import SessionAuthenticationCrossDomainCsrf
|
||||
from openedx.core.lib.api.paginators import DefaultPagination
|
||||
from student.models import CourseEnrollment
|
||||
from student.models import CourseEnrollmentException, AlreadyEnrolledError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EntitlementsPagination(DefaultPagination):
|
||||
"""
|
||||
Paginator for entitlements API.
|
||||
"""
|
||||
page_size = 50
|
||||
max_page_size = 100
|
||||
|
||||
|
||||
class EntitlementViewSet(viewsets.ModelViewSet):
|
||||
ENTITLEMENT_UUID4_REGEX = '[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'
|
||||
|
||||
@@ -33,6 +42,7 @@ class EntitlementViewSet(viewsets.ModelViewSet):
|
||||
serializer_class = CourseEntitlementSerializer
|
||||
filter_backends = (DjangoFilterBackend,)
|
||||
filter_class = CourseEntitlementFilter
|
||||
pagination_class = EntitlementsPagination
|
||||
|
||||
def get_queryset(self):
|
||||
user = self.request.user
|
||||
|
||||
Reference in New Issue
Block a user