diff --git a/make_post_sell/views/cart.py b/make_post_sell/views/cart.py index d3a23b2..7eaf968 100644 --- a/make_post_sell/views/cart.py +++ b/make_post_sell/views/cart.py @@ -1069,6 +1069,13 @@ def paypal_complete_checkout(request): continue if successful_invoices: + # MPS-20 + MPS-21: flip linked auction/offer state BEFORE + # the cart_offers / cart_auctions get touched downstream. + # Without this, a PayPal- or Adyen-paid negotiated cart + # leaves the offer stuck in ACCEPTED and the UI keeps + # showing Pay/Cancel even though the invoice is settled. + _finalize_auction_offer_state(cart, request) + for invoice in successful_invoices: for line_item in invoice.line_items: cart.remove_product(line_item.product, line_item.quantity) @@ -1304,6 +1311,13 @@ def adyen_complete_checkout(request): continue if successful_invoices: + # MPS-20 + MPS-21: flip linked auction/offer state BEFORE + # the cart_offers / cart_auctions get touched downstream. + # Without this, a PayPal- or Adyen-paid negotiated cart + # leaves the offer stuck in ACCEPTED and the UI keeps + # showing Pay/Cancel even though the invoice is settled. + _finalize_auction_offer_state(cart, request) + for invoice in successful_invoices: for line_item in invoice.line_items: cart.remove_product(line_item.product, line_item.quantity)