mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Add extra validation step
This commit is contained in:
		| @@ -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) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user