1
0
mirror of https://github.com/etesync/server synced 2024-11-22 16:58:08 +00:00

Chunks: add stricter validation.

This commit is contained in:
Tom Hacohen 2020-06-04 16:52:56 +03:00
parent e062fcd429
commit 653341115f

View File

@ -91,6 +91,8 @@ class ChunksField(serializers.RelatedField):
return (obj.uid, ) return (obj.uid, )
def to_internal_value(self, data): 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])) return (data[0], b64decode(data[1]))