Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix: delete variants can be fulfilled without crashing

NyanKiyoshi0dd7d40dcb94
diff --git a/saleor/dashboard/order/utils.py b/saleor/dashboard/order/utils.py
index b4b52079bb..e54b3876f2 100644
--- a/saleor/dashboard/order/utils.py
+++ b/saleor/dashboard/order/utils.py
@@ -47,7 +47,7 @@ def create_packing_slip_pdf(order, fulfillment, absolute_url):
def fulfill_order_line(order_line, quantity):
"""Fulfill order line with given quantity."""
- if order_line.variant.track_inventory:
+ if order_line.variant and order_line.variant.track_inventory:
decrease_stock(order_line.variant, quantity)
order_line.quantity_fulfilled += quantity
order_line.save(update_fields=['quantity_fulfilled'])