From 73041a3fe657668695aa001148e7b1beffd17302 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 20 May 2019 07:53:23 +1000 Subject: [PATCH] Fix div-by-zero for part pricing --- InvenTree/part/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index d5824b2dab..98a209b714 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -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 = {