Skip to content

Commit

Permalink
fix: remove pagination from group summaries (#3090)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Dec 4, 2023
1 parent d301104 commit 1065ad0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/tests/unit/organisations/test_unit_organisations_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,12 +1664,12 @@ def test_list_group_summaries(
assert response.status_code == status.HTTP_200_OK

response_json = response.json()
assert response_json["count"] == 2
assert response_json["results"][0] == {
assert len(response_json) == 2
assert response_json[0] == {
"id": user_permission_group_1.id,
"name": user_permission_group_1.name,
}
assert response_json["results"][1] == {
assert response_json[1] == {
"id": user_permission_group_2.id,
"name": user_permission_group_2.name,
}
Expand Down
5 changes: 5 additions & 0 deletions api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ def get_queryset(self):

return qs

def paginate_queryset(self, queryset: QuerySet) -> list[UserPermissionGroup] | None:
if self.action == "summaries":
return None
return super().paginate_queryset(queryset)

def get_serializer_class(self):
if self.action == "retrieve":
return UserPermissionGroupSerializerDetail
Expand Down

3 comments on commit 1065ad0

@vercel
Copy link

@vercel vercel bot commented on 1065ad0 Dec 4, 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.vercel.app
docs.flagsmith.com
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on 1065ad0 Dec 4, 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 1065ad0 Dec 4, 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.