diff --git a/tailbone/views/purchasing/ordering.py b/tailbone/views/purchasing/ordering.py index 32db947a..fb1a6a4f 100644 --- a/tailbone/views/purchasing/ordering.py +++ b/tailbone/views/purchasing/ordering.py @@ -202,11 +202,15 @@ class OrderingBatchView(PurchasingBatchView): if not cases_ordered or not cases_ordered.isdigit(): return {'error': "Invalid value for cases ordered: {}".format(cases_ordered)} cases_ordered = int(cases_ordered) + if cases_ordered >= 100000: # TODO: really this depends on underlying column + return {'error': "Invalid value for cases ordered: {}".format(cases_ordered)} units_ordered = self.request.POST.get('units_ordered', '0') if not units_ordered or not units_ordered.isdigit(): return {'error': "Invalid value for units ordered: {}".format(units_ordered)} units_ordered = int(units_ordered) + if units_ordered >= 100000: # TODO: really this depends on underlying column + return {'error': "Invalid value for units ordered: {}".format(units_ordered)} uuid = self.request.POST.get('product_uuid') product = self.Session.query(model.Product).get(uuid) if uuid else None