Skip to content

Commit

Permalink
fix: smaller pagnination size for list view (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnagro authored Nov 29, 2023
2 parents 0bd24b9 + 6335368 commit c37e6dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion enterprise_access/apps/api/v1/views/subsidy_access_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def _get_user_message_for_reason(reason_slug, enterprise_admin_users):
return MISSING_SUBSIDY_ACCESS_POLICY_REASONS[reason_slug]


class SubsidyAccessPolicyPagination(PaginationWithPageCount):
"""
Set a smaller page size for SubsidyAccessPolicy list views.
"""
max_page_size = 10


class SubsidyAccessPolicyViewSet(
mixins.CreateModelMixin,
mixins.ListModelMixin,
Expand All @@ -163,7 +170,7 @@ class SubsidyAccessPolicyViewSet(
authentication_classes = (JwtAuthentication, authentication.SessionAuthentication)
filter_backends = (filters.NoFilterOnDetailBackend,)
filterset_class = filters.SubsidyAccessPolicyFilter
pagination_class = PaginationWithPageCount
pagination_class = SubsidyAccessPolicyPagination
lookup_field = 'uuid'

def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit c37e6dd

Please sign in to comment.