🐛(backend) fix UnorderedObjectListWarning for DocumentAskForAccess

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.
This commit is contained in:
Manuel Raynaud
2026-06-02 19:47:31 +02:00
parent 5b70c5aecb
commit 9bdf36a323
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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
+1 -1
View File
@@ -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