Commits

Kai Diefenbach committed 9b49d81

Fixed calculation of shipping prices if no tax is given.

Comments (0)

Files changed (1)

lfs/shipping/__init__.py

     def get_price_net(self):
         """See lfs.plugins.ShippingMethodPriceCalculator.
         """
-        return self.shipping_method.price / ((100 + self.shipping_method.tax.rate) / 100)
+        try:
+            return self.shipping_method.price / ((100 + self.shipping_method.tax.rate) / 100)
+        except AttributeError:
+            return self.shipping_method.price
 
     def get_price_gross(self):
         """See lfs.plugins.ShippingMethodPriceCalculator.
     def get_price_gross(self):
         """See lfs.plugins.ShippingMethodPriceCalculator.
         """
-        return self.shipping_method.price * ((100 + self.shipping_method.tax.rate) / 100)
+        try:
+            return self.shipping_method.price * ((100 + self.shipping_method.tax.rate) / 100)
+        except AttributeError:
+            return self.shipping_method.price