From 2bdfc8bc0be082e523a6a57c8c6197432256d391 Mon Sep 17 00:00:00 2001 From: Nicolas PASCAL Date: Thu, 9 Apr 2020 16:58:24 +0200 Subject: [PATCH] refix test_order.py --- shop/serializers/bases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shop/serializers/bases.py b/shop/serializers/bases.py index e9099fba9..422640bbe 100644 --- a/shop/serializers/bases.py +++ b/shop/serializers/bases.py @@ -50,8 +50,8 @@ class Meta: def __init__(self, product, *args, **kwargs): kwargs.setdefault('label', 'catalog') super(ProductSerializer, self).__init__(product, *args, **kwargs) - if 'with_direct_siblings' in kwargs['context']['view'].kwargs and kwargs[ - 'context']['view'].kwargs['with_direct_siblings']: + if 'view' in kwargs['context'] and 'with_direct_siblings' in kwargs['context'][ + 'view'].kwargs and kwargs['context']['view'].kwargs['with_direct_siblings']: self.prev, self.next = self.get_object_with_direct_siblings( product, kwargs['context']['request']) self.request = kwargs['context']['request']