Skip to content

Commit

Permalink
Merge pull request #1843 from uktrade/uat
Browse files Browse the repository at this point in the history
Production release
  • Loading branch information
kevincarrogan authored Feb 26, 2024
2 parents 2002d90 + 98dda6d commit a86154a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/data_workspace/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ class OrganisationListView(viewsets.ReadOnlyModelViewSet):
authentication_classes = (DataWorkspaceOnlyAuthentication,)
serializer_class = OrganisationDetailSerializer
pagination_class = LimitOffsetPagination
queryset = Organisation.objects.all()
# We ensure that organisations with the same name always come out
# in the same order by additionally ordering by created_at
# and by id. If just name is used, the order is non-deterministic
# when multiple organisations have the same name. This can mean the
# same organisation being emitted on different pages, causing
# primary key violations in Data Workspace.
queryset = Organisation.objects.order_by("name", "created_at", "id")


class PartyListView(viewsets.ReadOnlyModelViewSet):
Expand Down

0 comments on commit a86154a

Please sign in to comment.