From 8c5d1f66be9e1ec9d63c549782188abcf587c9e6 Mon Sep 17 00:00:00 2001 From: Jacob Rief Date: Sat, 11 Apr 2020 23:10:05 +0200 Subject: [PATCH] fix #802: Error with REST serializer when adding to cart --- shop/rest/fields.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shop/rest/fields.py b/shop/rest/fields.py index 47bbd3202..26f2bf97d 100644 --- a/shop/rest/fields.py +++ b/shop/rest/fields.py @@ -20,6 +20,9 @@ class JSONSerializerField(serializers.Field): """ Serializer field which transparently bypasses its object instead of serializing/deserializing. """ + def __init__(self, encoder=None, **kwargs): + super(JSONSerializerField, self).__init__(**kwargs) + def to_representation(self, obj): return obj