mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
catch a ValueError
This commit is contained in:
@ -251,12 +251,16 @@ class StockItemMoveMultiple(AjaxView, FormMixin):
|
|||||||
valid = False
|
valid = False
|
||||||
form.errors['confirm'] = [_('Confirm stock adjustment')]
|
form.errors['confirm'] = [_('Confirm stock adjustment')]
|
||||||
|
|
||||||
|
destination = None
|
||||||
|
destination_name = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
destination = StockLocation.objects.get(id=form['destination'].value())
|
destination = StockLocation.objects.get(id=form['destination'].value())
|
||||||
destination_name = destination.pathstring
|
destination_name = destination.pathstring
|
||||||
except StockLocation.DoesNotExist:
|
except StockLocation.DoesNotExist:
|
||||||
destination = None
|
pass
|
||||||
destination_name = ""
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'form_valid': valid,
|
'form_valid': valid,
|
||||||
|
Reference in New Issue
Block a user