2
0
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:
Oliver Walters
2019-06-02 11:14:56 +10:00
parent 96f6f6068e
commit 1b7762470d

View File

@ -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,