From f147f4ae58561b89cbac32d70e937e7e5d41ad83 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 29 Jun 2020 15:31:29 +0300 Subject: [PATCH] Serializers: allow encryptionKey to be null. --- django_etebase/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index f78cd6b..f2da771 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -122,7 +122,7 @@ class CollectionItemRevisionSerializer(serializers.ModelSerializer): class CollectionItemSerializer(serializers.ModelSerializer): - encryptionKey = BinaryBase64Field(required=False, default=None) + encryptionKey = BinaryBase64Field(required=False, default=None, allow_null=True) etag = serializers.CharField(allow_null=True, write_only=True) content = CollectionItemRevisionSerializer(many=False) @@ -192,7 +192,7 @@ class CollectionSerializer(serializers.ModelSerializer): stoken = serializers.CharField(read_only=True) uid = serializers.CharField(source='main_item.uid') - encryptionKey = BinaryBase64Field(source='main_item.encryptionKey', required=False, default=None) + encryptionKey = BinaryBase64Field(source='main_item.encryptionKey', required=False, default=None, allow_null=True) etag = serializers.CharField(allow_null=True, write_only=True) version = serializers.IntegerField(min_value=0, source='main_item.version') content = CollectionItemRevisionSerializer(many=False, source='main_item.content')