mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add extra validation step
This commit is contained in:
parent
8d5c4c521c
commit
6561a613d7
@ -154,7 +154,10 @@ class StockMove(APIView):
|
|||||||
if 'location' not in data:
|
if 'location' not in data:
|
||||||
raise ValidationError({'location': 'Destination must be specified'})
|
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:
|
try:
|
||||||
location = StockLocation.objects.get(pk=loc_id)
|
location = StockLocation.objects.get(pk=loc_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user