Skip to content

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

Fix TypeError on logging allocation error

Damian W81bee034743e
diff --git a/saleor/order/actions.py b/saleor/order/actions.py
index f12f47f2dd..aa5ba7edeb 100644
--- a/saleor/order/actions.py
+++ b/saleor/order/actions.py
@@ -630,8 +630,9 @@ def _move_order_lines_to_target_fulfillment(
try:
deallocate_stock(lines_to_dellocate)
except AllocationError as e:
+ lines = [str(line.pk) for line in e.order_lines]
logger.warning(
- f"Unable to deallocate stock for line {', '.join(e.order_lines)}."
+ "Unable to deallocate stock for lines.", extra={"lines": lines}
)
created_fulfillment_lines = FulfillmentLine.objects.bulk_create(