Skip to content
Snippets Groups Projects
Commit 13b36b2b authored by Erwan Rouchet's avatar Erwan Rouchet
Browse files

Merge branch 'list-elements-broken-pagination' into 'master'

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

See merge request !540
parents 72bfbfbb 14ecc05a
No related branches found
No related tags found
1 merge request!540Fix an error occuring on DB pagination for elements with common corpus, type and name
......@@ -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