I am encountering an error on Django Series 2- Designing And Implementing AaShopping cart API. When I tried adding a cart item despite coding along with Mosh, I came across the below error
IntegrityError at /store/carts/9c7ff644fd67461b9f9a674cff574ef9/item/
(1048, “Column ‘cart_id’ cannot be null”).
Any help to scale through this will be appreciated. Thanks
I have found my way out of the above problem. Instead of typing self.request.method == "POST’ in the if-block inside the def get_serializer_class of the CartItemViewSet, I realized I wrongly typed self.request.method == ‘GET’