Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Oct 18, 2023
1 parent 383d3f3 commit f745aab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/openforms/forms/api/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class FormDefinitionPagination(pagination.PageNumberPagination):
"""A page number pagination that will be disabled if the specific query parameter
for page size is set to 0.
"""

page_size = 25
page_size_query_param = "page_size"
max_page_size = None

def get_page_size(self, request) -> int | None:
if self.page_size_query_param and request.query_params.get(self.page_query_param) == 0:
if (
self.page_size_query_param
and request.query_params.get(self.page_query_param) == 0
):
return None
return super().get_page_size(request)

0 comments on commit f745aab

Please sign in to comment.