mirror of
https://github.com/suitenumerique/docs.git
synced 2026-08-26 17:32:28 +02:00
🐛(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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user