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

Allow an element's parent field to be set to null

parent 0b986a5b
No related branches found
No related tags found
1 merge request!767Allow an element's parent field to be set to null
......@@ -285,7 +285,7 @@ class ElementCreateSerializer(ElementLightSerializer):
required=False,
help_text='Link this element to an image by UUID via a polygon.',
)
parent = serializers.PrimaryKeyRelatedField(queryset=Element.objects.none(), required=False)
parent = serializers.PrimaryKeyRelatedField(queryset=Element.objects.none(), required=False, allow_null=True)
polygon = PolygonField(
required=False,
help_text='Set the polygon linking this element to the image. '
......
......@@ -297,6 +297,7 @@ class TestElementsAPI(FixtureAPITestCase):
'corpus': str(volume.corpus.id),
'name': volume.name,
'type': volume.type.slug,
'parent': None,
'source': None,
}
)
......@@ -323,6 +324,7 @@ class TestElementsAPI(FixtureAPITestCase):
'corpus': str(page.corpus.id),
'name': page.name,
'type': page.type.slug,
'parent': None,
'source': None,
}
)
......@@ -385,6 +387,7 @@ class TestElementsAPI(FixtureAPITestCase):
'corpus': str(page.corpus.id),
'name': page.name,
'type': page.type.slug,
'parent': None,
'source': None,
}
)
......
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