mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	fix plugin init sequence
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user