Skip to content

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

@shamspias

Description

@shamspias

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions