Skip to content

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

Improve getting delivery cost (fixes case when weight is 0)

Marcin Gębala7d3db35babe2
diff --git a/saleor/delivery/__init__.py b/saleor/delivery/__init__.py
index 0c74dc02ac..4df98fa2f8 100644
--- a/saleor/delivery/__init__.py
+++ b/saleor/delivery/__init__.py
@@ -34,7 +34,7 @@ class DummyShipping(BaseDelivery):
return 'Dummy shipping'
def get_delivery_total(self, weight=None, **kwargs):
- if not weight:
+ if weight is None:
weight = sum(line.product.get_weight() for line in self.group)
qty = sum(line.quantity for line in self.group)
return Price(qty * weight,