Fix div-by-zero for part pricing

This commit is contained in:
Oliver Walters 2019-05-20 07:53:23 +10:00
parent 2e2c51b271
commit 73041a3fe6

View File

@ -567,6 +567,14 @@ class PartPricing(AjaxView):
def get_pricing(self, quantity=1):
try:
quantity = int(quantity)
except ValueError:
quantity = 1
if quantity < 1:
quantity = 1
part = self.get_part()
ctx = {