mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 20:15:44 +00:00
removes all lines consisting only of spaces
this really bothers me for some reason - nothing technical
This commit is contained in:
@ -73,7 +73,7 @@ class BarcodeScan(APIView):
|
||||
|
||||
# A plugin has been found!
|
||||
if plugin is not None:
|
||||
|
||||
|
||||
# Try to associate with a stock item
|
||||
item = plugin.getStockItem()
|
||||
|
||||
@ -133,7 +133,7 @@ class BarcodeScan(APIView):
|
||||
class BarcodeAssign(APIView):
|
||||
"""
|
||||
Endpoint for assigning a barcode to a stock item.
|
||||
|
||||
|
||||
- This only works if the barcode is not already associated with an object in the database
|
||||
- If the barcode does not match an object, then the barcode hash is assigned to the StockItem
|
||||
"""
|
||||
@ -178,7 +178,7 @@ class BarcodeAssign(APIView):
|
||||
|
||||
# Matching plugin was found
|
||||
if plugin is not None:
|
||||
|
||||
|
||||
hash = plugin.hash()
|
||||
response['hash'] = hash
|
||||
response['plugin'] = plugin.name
|
||||
@ -234,7 +234,7 @@ class BarcodeAssign(APIView):
|
||||
barcode_api_urls = [
|
||||
|
||||
url(r'^link/$', BarcodeAssign.as_view(), name='api-barcode-link'),
|
||||
|
||||
|
||||
# Catch-all performs barcode 'scan'
|
||||
url(r'^.*$', BarcodeScan.as_view(), name='api-barcode-scan'),
|
||||
]
|
||||
|
@ -21,7 +21,7 @@ def hash_barcode(barcode_data):
|
||||
|
||||
HACK: Remove any 'non printable' characters from the hash,
|
||||
as it seems browers will remove special control characters...
|
||||
|
||||
|
||||
TODO: Work out a way around this!
|
||||
"""
|
||||
|
||||
|
@ -92,7 +92,7 @@ class BarcodeAPITest(APITestCase):
|
||||
data = response.data
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
|
||||
self.assertIn('stockitem', data)
|
||||
|
||||
pk = data['stockitem']['pk']
|
||||
@ -121,7 +121,7 @@ class BarcodeAPITest(APITestCase):
|
||||
data = response.data
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
|
||||
self.assertIn('success', data)
|
||||
|
||||
hash = data['hash']
|
||||
|
Reference in New Issue
Block a user