Skip to content
Snippets Groups Projects
Verified Commit 899ba311 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Do not fail on library page scan if one item is invalid

parent 852bed6f
No related branches found
No related tags found
No related merge requests found
......@@ -616,10 +616,12 @@ class CollectionPageSerializer(serializers.Serializer):
if not item_serializer:
return v
raw_items = [item_serializer(data=i, context=self.context) for i in v]
valid_items = []
for i in raw_items:
i.is_valid(raise_exception=True)
if i.is_valid():
valid_items.append(i)
return raw_items
return valid_items
def to_representation(self, conf):
page = conf['page']
......
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