Improve error handling for purchase batch
so error will display in browser when applicable
This commit is contained in:
parent
82e730c18e
commit
97bdc3f785
|
@ -428,8 +428,11 @@ class OrderingBatchView(PurchasingBatchView):
|
||||||
self.handler.add_row(batch, row)
|
self.handler.add_row(batch, row)
|
||||||
|
|
||||||
# update row quantities
|
# update row quantities
|
||||||
self.handler.update_row_quantity(row, cases_ordered=cases_ordered,
|
try:
|
||||||
units_ordered=units_ordered)
|
self.handler.update_row_quantity(row, cases_ordered=cases_ordered,
|
||||||
|
units_ordered=units_ordered)
|
||||||
|
except Exception as error:
|
||||||
|
return {'error': six.text_type(error)}
|
||||||
|
|
||||||
else: # empty order quantities
|
else: # empty order quantities
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue