Skip to content

🐛(backend) fix UnorderedObjectListWarning for DocumentAskForAccess viewset#2382

Merged
lunika merged 2 commits into
mainfrom
fix/pagination
Jun 2, 2026
Merged

🐛(backend) fix UnorderedObjectListWarning for DocumentAskForAccess viewset#2382
lunika merged 2 commits into
mainfrom
fix/pagination

Conversation

@lunika
Copy link
Copy Markdown
Member

@lunika lunika commented Jun 2, 2026

Purpose

In the tests there is a UnorderedObjectListWarning, we also find this same
warning in the logs in production. This warning appears because the
queryset used by the DocumentAskForAccess paginator is not ordered and
can lead to inconsistent result. Ordering the queryset fix this warning.

Proposal

  • 🐛(backend) fix UnorderedObjectListWarning for DocumentAskForAccess viewset
  • 🔥(backend) remove unused order parameter in Paginator class

@lunika lunika requested a review from jmaupetit June 2, 2026 16:03
@lunika lunika self-assigned this Jun 2, 2026
@lunika lunika added the backend label Jun 2, 2026
lunika added 2 commits June 2, 2026 19:47
In the tests there is a UnorderedObjectListWarning, we also find this same
warning in the logs in production. This warning appears because the
queryset used by the DocumentAskForAccess paginator is not ordered and
can lead to inconsistent result. Ordering the queryset fix this warning.
In the custom Paginator present in the viewset, an ordering parameter
was set. This parameter is never used by the DRF paginator and can be
removed.
@lunika lunika merged commit dc692a1 into main Jun 2, 2026
44 of 45 checks passed
@lunika lunika deleted the fix/pagination branch June 2, 2026 18:09
@AntoLC AntoLC mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants