mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 13:06:45 +00:00
* Ignore 3rd party barcode plugins when assigning barcode * Use single quotes
This commit is contained in:
parent
4973d9c726
commit
55f09d8723
@ -147,16 +147,16 @@ class BarcodeAssign(BarcodeView):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Here we only check against 'InvenTree' plugins
|
# Here we only check against 'InvenTree' plugins
|
||||||
plugins = registry.with_mixin('barcode', builtin=True)
|
inventree_barcode_plugin = registry.get_plugin('inventreebarcode')
|
||||||
|
|
||||||
# First check if the provided barcode matches an existing database entry
|
# First check if the provided barcode matches an existing database entry
|
||||||
for plugin in plugins:
|
if inventree_barcode_plugin:
|
||||||
result = plugin.scan(barcode)
|
result = inventree_barcode_plugin.scan(barcode)
|
||||||
|
|
||||||
if result is not None:
|
if result is not None:
|
||||||
result["error"] = _("Barcode matches existing item")
|
result['error'] = _('Barcode matches existing item')
|
||||||
result["plugin"] = plugin.name
|
result['plugin'] = inventree_barcode_plugin.name
|
||||||
result["barcode_data"] = barcode
|
result['barcode_data'] = barcode
|
||||||
|
|
||||||
raise ValidationError(result)
|
raise ValidationError(result)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user