make sure to add the delivery_address to invoice on successful checkout

modified:   make_post_sell/views/cart.py
This commit is contained in:
Russell Ballestrini 2024-06-16 20:39:11 -04:00
parent 8e9d704f60
commit 3d0ad9f1be

View file

@ -470,6 +470,10 @@ def cart_complete_checkout(request):
invoice.handling_option = cart.handling_option
invoice.handling_cost_in_cents = cart.handling_cost_in_cents
# Copy the user's active address to the invoice
if cart.physical_products:
invoice.delivery_address = request.user.active_address.data
for product, quantity in product_quantity_tuple:
product.unlock_for_user(request.user)
request.dbsession.add(product)