From 9bdf36a3239a824bfb4c69175a91cfafd7fdffde Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 2 Jun 2026 17:59:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20fix=20UnorderedObjectLi?= =?UTF-8?q?stWarning=20for=20DocumentAskForAccess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- CHANGELOG.md | 1 + src/backend/core/api/viewsets.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1039541b..21ee3164c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to - 🐛(frontend) fix toolbar blocknote hidden #2373 - 🐛(frontend) fix application crashes when using GTranslate and zoom #2372 - 🐛(frontend) fix emoji pdf not matching #2375 +- 🐛(backend) fix UnorderedObjectListWarning for DocumentAskForAccess viewset ## [v5.1.0] - 2026-05-11 diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py index 6ccf95865..cbaf51c5c 100644 --- a/src/backend/core/api/viewsets.py +++ b/src/backend/core/api/viewsets.py @@ -2943,7 +2943,7 @@ class DocumentAskForAccessViewSet( permissions.ResourceWithAccessPermission, ] throttle_scope = "document_ask_for_access" - queryset = models.DocumentAskForAccess.objects.all() + queryset = models.DocumentAskForAccess.objects.all().order_by("updated_at") serializer_class = serializers.DocumentAskForAccessSerializer _document = None