diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index f67f97f4b6..7397f45370 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -154,7 +154,10 @@ class StockMove(APIView): if 'location' not in data: raise ValidationError({'location': 'Destination must be specified'}) - loc_id = data.get(u'location') + try: + loc_id = int(data.get('location')) + except ValueError: + raise ValidationError({'location': 'Integer ID required'}) try: location = StockLocation.objects.get(pk=loc_id)