mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-08 19:26:29 +00:00
catch a ValueError
This commit is contained in:
1 parent
96f6f6068e
commit
1b7762470d
1 file changed
+6
-2
@@ -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