Skip to content

Commit

Permalink
Grab basket object from build_submission(), not from request
Browse files Browse the repository at this point in the history
When the RedirectView is used in combination with another
CheckoutSessionMixin defined for a DeferredTax taxation strategy, then
submission's basket object has critical tax information, whereas
request.basket does not. Change RedirectView's basket reference to
point to build_submission()['basket'].

Fixes #98, reported by Nigel Fletton.
  • Loading branch information
fghaas authored and maiksprenger committed Jan 12, 2016
1 parent baf82b1 commit be89e19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ Tests
Changelog
---------

0.9.7 (unreleased)
------------------
* Fix breakage when using Oscar's ``DeferredTaxMixin``. `#98`_ `#121`_

.. _`#98`: https://github.com/django-oscar/django-oscar-paypal/issues/98
.. _`#121`: https://github.com/django-oscar/django-oscar-paypal/pull/121

0.9.6 (released November 13th, 2015)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion paypal/express/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RedirectView(CheckoutSessionMixin, RedirectView):

def get_redirect_url(self, **kwargs):
try:
basket = self.request.basket
basket = self.build_submission()['basket']
url = self._get_redirect_url(basket, **kwargs)
except PayPalError as ppe:
messages.error(
Expand Down

0 comments on commit be89e19

Please sign in to comment.