Skip to content
Snippets Groups Projects
Commit 14ecc05a authored by Valentin Rigal's avatar Valentin Rigal Committed by Erwan Rouchet
Browse files

Fix an error occuring on DB pagination for elements with common corpus, type and name

parent 72bfbfbb
No related branches found
No related tags found
No related merge requests found
......@@ -144,9 +144,10 @@ class ElementsList(CorpusACLMixin, ListAPIView):
)
filtered_queryset = filtered_queryset.prefetch_related(best_classifications_prefetch)
# ID is required by postgres to order elements with common corpus, type and name
return filtered_queryset \
.prefetch_related('corpus', 'zone__image__server', 'type') \
.order_by('corpus', 'type__slug', 'name')
.order_by('corpus', 'type__slug', 'name', 'id')
class ElementRetrieve(RetrieveUpdateDestroyAPIView):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment