fix: handle None case for get_shipping_amount_from_rules (#19724)

This commit is contained in:
Shivam Mishra
2019-11-28 16:47:14 +05:30
committed by Nabin Hait
parent cf645aceae
commit d8469a7bfa

View File

@@ -70,7 +70,7 @@ class ShippingRule(Document):
def get_shipping_amount_from_rules(self, value):
for condition in self.get("conditions"):
if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)):
if not condition.to_value or (flt(condition.from_value) <= flt(value) <= flt(condition.to_value)):
return condition.shipping_amount
return 0.0