divio/django-shop — pull request #194 by jrief (2012-11-05 09:34:19+00:00)
Title: Fixes create_from_cart, when argument state is used in one of the CartMo...

I wrote a few CartModifiers which require the "request" object. This is because I have to calculate the price, depending on the customers state. The customer is identified through the current logged in user, which is (as we all know) available through the ```request.user``` object.
To achieve this, I passed the "request" object as ```state={'request': request}``` to my CartModifiers. I think, this was one of the intentions for the optional ```state``` argument.

The problem however arrises, when the cart shall be transformed into an order using the ```OrderManager.create_from_cart``` method. Here instead of a free form state argument, the cart object itself is passed to the CartModifier. This, from my point of view, is inconsistent behavior and makes no sense in that context. It also prevents me from implementing this feature.

Jacob