From 2b344f1f25a88e84e910b836cb3d3a9a19a704a6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 15 Feb 2022 13:30:14 +1100 Subject: [PATCH] PEP style fixes --- InvenTree/build/models.py | 5 ++--- InvenTree/build/serializers.py | 4 ++-- InvenTree/build/views.py | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index bae1831efa..74b75787e7 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -695,11 +695,11 @@ class Build(MPTTModel, ReferenceIndexingMixin): ) if auto_allocate and serial is not None: - + # Get a list of BomItem objects which point to "trackable" parts for bom_item in self.part.get_trackable_parts(): - + parts = bom_item.get_valid_parts_for_allocation() for part in parts: @@ -725,7 +725,6 @@ class Build(MPTTModel, ReferenceIndexingMixin): install_into=output, ) - else: """ Create a single build output of the given quantity diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index 4529b5f92f..0b0858cb8a 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -285,9 +285,9 @@ class BuildOutputCreateSerializer(serializers.Serializer): """ Generate the new build output(s) """ - + data = self.validated_data - + quantity = data['quantity'] batch_code = data.get('batch_code', '') auto_allocate = data.get('auto_allocate', False) diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index 1051869f68..37fb024940 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -6,16 +6,14 @@ Django views for interacting with Build objects from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ -from django.core.exceptions import ValidationError from django.views.generic import DetailView, ListView -from django.forms import HiddenInput from .models import Build from . import forms from InvenTree.views import AjaxUpdateView, AjaxDeleteView from InvenTree.views import InvenTreeRoleMixin -from InvenTree.helpers import str2bool, extract_serial_numbers +from InvenTree.helpers import str2bool from InvenTree.status_codes import BuildStatus