From b2c40c91b7f5b019b5e91585d711d59dd0477437 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 20 Apr 2020 01:11:25 +1000 Subject: [PATCH] PEP fixes --- InvenTree/stock/api.py | 8 +------- InvenTree/stock/serializers.py | 3 --- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 1e27848eb9..bf85294c4e 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -5,7 +5,6 @@ JSON API for the Stock app from django_filters.rest_framework import FilterSet, DjangoFilterBackend from django_filters import NumberFilter -from django.conf import settings from django.conf.urls import url, include from django.urls import reverse from django.db.models import Q @@ -21,9 +20,7 @@ from .serializers import StockTrackingSerializer from InvenTree.views import TreeSerializer from InvenTree.helpers import str2bool, isNull -from InvenTree.status_codes import StockStatus -import os from decimal import Decimal, InvalidOperation from rest_framework.serializers import ValidationError @@ -326,11 +323,9 @@ class StockList(generics.ListCreateAPIView): try: part_detail = str2bool(self.request.query_params.get('part_detail', None)) location_detail = str2bool(self.request.query_params.get('location_detail', None)) - supplier_part_detail = str2bool(self.request.query_params.get('supplier_part_detail', None)) except AttributeError: part_detail = None location_detail = None - supplier_part_detail = None kwargs['part_detail'] = part_detail kwargs['location_detail'] = location_detail @@ -340,7 +335,7 @@ class StockList(generics.ListCreateAPIView): return self.serializer_class(*args, **kwargs) - # TODO - Override the 'create' method for this view, + # TODO - Override the 'create' method for this view, # to allow the user to be recorded when a new StockItem object is created def get_queryset(self, *args, **kwargs): @@ -350,7 +345,6 @@ class StockList(generics.ListCreateAPIView): return queryset - def filter_queryset(self, queryset): # Start with all objects diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py index a4de99040a..2953809cab 100644 --- a/InvenTree/stock/serializers.py +++ b/InvenTree/stock/serializers.py @@ -8,7 +8,6 @@ from .models import StockItem, StockLocation from .models import StockItemTracking from part.serializers import PartBriefSerializer -from company.serializers import SupplierPartSerializer from InvenTree.serializers import UserSerializerBrief, InvenTreeModelSerializer @@ -72,8 +71,6 @@ class StockItemSerializer(InvenTreeModelSerializer): ) status_text = serializers.CharField(source='get_status_display', read_only=True) - - #tracking_items = serializers.IntegerField(source='tracking_info_count', read_only=True) part_detail = PartBriefSerializer(source='part', many=False, read_only=True) location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)