Skip to content
Snippets Groups Projects
Commit de9cf063 authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Avoid a stale read when an export has just been created

parent e7ad37b4
No related branches found
No related tags found
1 merge request!2333Avoid a stale read when an export has just been created
......@@ -53,11 +53,14 @@ class CorpusExportAPIView(ListCreateAPIView):
return corpus
def get_queryset(self):
return CorpusExport \
.objects \
.filter(corpus=self.corpus) \
.select_related("user") \
return (
CorpusExport.objects
# Avoid a stale read when an export has just been created
.using("default")
.filter(corpus=self.corpus)
.select_related("user")
.order_by("-created")
)
def get_serializer_context(self):
context = super().get_serializer_context()
......
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