PEP fixes

This commit is contained in:
Oliver Walters 2020-04-20 01:11:25 +10:00
parent 0334035e77
commit b2c40c91b7
2 changed files with 1 additions and 10 deletions

View File

@ -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
@ -350,7 +345,6 @@ class StockList(generics.ListCreateAPIView):
return queryset
def filter_queryset(self, queryset):
# Start with all objects

View File

@ -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
@ -73,8 +72,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)