Skip to content
Snippets Groups Projects
Commit 925bca67 authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Fix stale read on CreateDatasetElement

parent 0c89baab
No related branches found
No related tags found
1 merge request!2323Fix stale read on CreateDatasetElement
This commit is part of merge request !2323. Comments created here will be created in the context of that merge request.
......@@ -717,7 +717,7 @@ class DatasetElementSerializer(serializers.ModelSerializer):
super().__init__(*args, **kwargs)
if dataset := self.context.get("dataset"):
self.fields["element_id"].queryset = Element.objects.filter(corpus=dataset.corpus)
self.fields["set"].queryset = dataset.sets.all()
self.fields["set"].queryset = dataset.sets.using("default")
def validate_element_id(self, element):
dataset = self.context.get("dataset")
......
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