django-oscar-api icon indicating copy to clipboard operation
django-oscar-api copied to clipboard

AttributeError: 'NoneType' object has no attribute 'strategy'

Open shamspias opened this issue 2 years ago • 3 comments

when trying to fetch baskets API to get anonymous cart information it shows

AttributeError: 'NoneType' object has no attribute 'strategy'

API: /api/baskets/ request: GET view: BasketList

problem point: oscarapi/views/basic.py 78 number line.

        else:  # anonymous users have max 1 basket.
            basket = get_anonymous_basket(self.request)
            mapped_with_baskets = [prepare_basket(basket, self.request)]

if no cart/basket is in session it shows an error but needs an error handler.

shamspias avatar Oct 25 '22 08:10 shamspias