mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
fix plugin init sequence
This commit is contained in:
parent
632632c8ad
commit
d03c636067
@ -60,11 +60,12 @@ class BarcodeScan(APIView):
|
|||||||
# Look for a barcode plugin which knows how to deal with this barcode
|
# Look for a barcode plugin which knows how to deal with this barcode
|
||||||
plugin = None
|
plugin = None
|
||||||
|
|
||||||
for plugin_class in plugins:
|
for current_plugin in plugins:
|
||||||
plugin_instance = plugin_class(barcode_data)
|
# TODO @matmair make simpler after InvenTree 0.7.0 release
|
||||||
|
current_plugin.init(barcode_data)
|
||||||
|
|
||||||
if plugin_instance.validate():
|
if current_plugin.validate():
|
||||||
plugin = plugin_instance
|
plugin = current_plugin
|
||||||
break
|
break
|
||||||
|
|
||||||
match_found = False
|
match_found = False
|
||||||
@ -164,11 +165,12 @@ class BarcodeAssign(APIView):
|
|||||||
|
|
||||||
plugin = None
|
plugin = None
|
||||||
|
|
||||||
for plugin_class in plugins:
|
for current_plugin in plugins:
|
||||||
plugin_instance = plugin_class(barcode_data)
|
# TODO @matmair make simpler after InvenTree 0.7.0 release
|
||||||
|
current_plugin.init(barcode_data)
|
||||||
|
|
||||||
if plugin_instance.validate():
|
if current_plugin.validate():
|
||||||
plugin = plugin_instance
|
plugin = current_plugin
|
||||||
break
|
break
|
||||||
|
|
||||||
match_found = False
|
match_found = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user