Skip to content

Commit

Permalink
fix(edge-identity-view): reduce max page size to 100 (#2937)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi authored Nov 21, 2023
1 parent 85e25dd commit 6c4807f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/app/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def get_paginated_response(self, paginator, response_schema):


class EdgeIdentityPagination(CustomPagination):
max_page_size = 100
page_size = 100

def paginate_queryset(self, dynamo_queryset, request, view=None):
last_evaluated_key = dynamo_queryset.get("LastEvaluatedKey")
if last_evaluated_key:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ def test_get_identities_list(
edge_identity_dynamo_wrapper_mock,
):
# Given
url = reverse(
base_url = reverse(
"api-v1:environments:environment-edge-identities-list",
args=[environment_api_key],
)
url = f"{base_url}?page_size=9999"

edge_identity_dynamo_wrapper_mock.get_all_items.return_value = {
"Items": [identity_document],
Expand All @@ -232,7 +233,7 @@ def test_get_identities_list(
# Then
assert response.status_code == status.HTTP_200_OK
edge_identity_dynamo_wrapper_mock.get_all_items.assert_called_with(
environment_api_key, 999, None
environment_api_key, 100, None
)


Expand Down Expand Up @@ -268,7 +269,7 @@ def test_search_identities_without_exact_match(
environment_api_key,
identifier,
EdgeIdentityViewSet.dynamo_identifier_search_functions["BEGINS_WITH"],
999,
100,
None,
)

Expand Down Expand Up @@ -307,7 +308,7 @@ def test_search_for_identities_with_exact_match(
environment_api_key,
identifier,
EdgeIdentityViewSet.dynamo_identifier_search_functions["EQUAL"],
999,
100,
None,
)

Expand Down

3 comments on commit 6c4807f

@vercel
Copy link

@vercel vercel bot commented on 6c4807f Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6c4807f Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs.bullet-train.io
docs-flagsmith.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 6c4807f Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.