Chunks: add stricter validation.

master
Tom Hacohen 5 years ago
parent e062fcd429
commit 653341115f

@ -91,6 +91,8 @@ class ChunksField(serializers.RelatedField):
return (obj.uid, )
def to_internal_value(self, data):
if data[0] is None or data[1] is None:
raise serializers.ValidationError('null is not allowed')
return (data[0], b64decode(data[1]))

Loading…
Cancel
Save