mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Flake fixes
This commit is contained in:
		@@ -1,7 +1,5 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import hashlib
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from django.urls import reverse
 | 
					from django.urls import reverse
 | 
				
			||||||
from django.conf.urls import url
 | 
					from django.conf.urls import url
 | 
				
			||||||
from django.utils.translation import ugettext as _
 | 
					from django.utils.translation import ugettext as _
 | 
				
			||||||
@@ -11,13 +9,10 @@ from rest_framework import permissions
 | 
				
			|||||||
from rest_framework.response import Response
 | 
					from rest_framework.response import Response
 | 
				
			||||||
from rest_framework.views import APIView
 | 
					from rest_framework.views import APIView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import InvenTree.plugins as InvenTreePlugins
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from stock.models import StockItem
 | 
					from stock.models import StockItem
 | 
				
			||||||
from stock.serializers import StockItemSerializer
 | 
					from stock.serializers import StockItemSerializer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import barcode.plugins as BarcodePlugins
 | 
					from barcode.barcode import load_barcode_plugins, hash_barcode
 | 
				
			||||||
from barcode.barcode import BarcodePlugin, load_barcode_plugins, hash_barcode
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BarcodeScan(APIView):
 | 
					class BarcodeScan(APIView):
 | 
				
			||||||
@@ -233,7 +228,6 @@ class BarcodeAssign(APIView):
 | 
				
			|||||||
            serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_part_detail=True)
 | 
					            serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_part_detail=True)
 | 
				
			||||||
            response['stockitem'] = serializer.data
 | 
					            response['stockitem'] = serializer.data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        return Response(response)
 | 
					        return Response(response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import hashlib
 | 
					import hashlib
 | 
				
			||||||
import json
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from InvenTree import plugins as InvenTreePlugins
 | 
					from InvenTree import plugins as InvenTreePlugins
 | 
				
			||||||
from barcode import plugins as BarcodePlugins
 | 
					from barcode import plugins as BarcodePlugins
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from stock.models import StockItem
 | 
				
			||||||
from stock.serializers import StockItemSerializer, LocationSerializer
 | 
					from stock.serializers import StockItemSerializer, LocationSerializer
 | 
				
			||||||
from part.serializers import PartSerializer
 | 
					from part.serializers import PartSerializer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -70,7 +70,6 @@ class BarcodePlugin:
 | 
				
			|||||||
        serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_part_detail=True)
 | 
					        serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_part_detail=True)
 | 
				
			||||||
        return serializer.data
 | 
					        return serializer.data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def getStockLocation(self):
 | 
					    def getStockLocation(self):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Attempt to retrieve a StockLocation associated with this barcode.
 | 
					        Attempt to retrieve a StockLocation associated with this barcode.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,7 +47,6 @@ def get_plugins(pkg, baseclass):
 | 
				
			|||||||
    return plugins
 | 
					    return plugins
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
def load_action_plugins():
 | 
					def load_action_plugins():
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Return a list of all registered action plugins
 | 
					    Return a list of all registered action plugins
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
ignore =
 | 
					ignore =
 | 
				
			||||||
	# - W293 - blank lines contain whitespace
 | 
						# - W293 - blank lines contain whitespace
 | 
				
			||||||
	W293,
 | 
						W293,
 | 
				
			||||||
 | 
						W605,
 | 
				
			||||||
	# - E501 - line too long (82 characters)
 | 
						# - E501 - line too long (82 characters)
 | 
				
			||||||
	E501, E722,
 | 
						E501, E722,
 | 
				
			||||||
	# - C901 - function is too complex
 | 
						# - C901 - function is too complex
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user