Ensure that the native barcode scan plugin is *always* in use

This commit is contained in:
Oliver 2022-03-07 09:48:39 +11:00
parent 776138f2e2
commit 0f48ca6008

View File

@ -12,6 +12,7 @@ from rest_framework.views import APIView
from stock.models import StockItem
from stock.serializers import StockItemSerializer
from barcodes.plugins.inventree_barcode import InvenTreeBarcodePlugin
from barcodes.barcode import hash_barcode
from plugin import registry
@ -57,6 +58,9 @@ class BarcodeScan(APIView):
barcode_data = data.get('barcode')
# Ensure that the default barcode handler is installed
plugins.append(InvenTreeBarcodePlugin())
# Look for a barcode plugin which knows how to deal with this barcode
plugin = None