SimplePayShipForm requires saved order on init

Issue #1322 resolved
Artem Gluvchynsky
created an issue

Changeset <<changeset b8bc28184e3d>> introduced a partial payment check in SimplePayShipForm.init. The code implies that order has been already saved and present in the session. However, form itself doesn't require this unless we're saving it and moreover explicitly handles the case when order isn't present:

{{{

!python

try: order = Order.objects.from_request(request) except Order.DoesNotExist: order = None self.order = order }}}

This isn't really a bug but breaks a usage case when developer wants to initialize this form (or one of its children forms) before saving the order. In my case it is a one-page checkout view that doesn't have a saved order at this stage. Same code works fine on 0.9.1.

To fix this checking for existence of an order is enough.

Comments (3)

  1. Log in to comment