mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
PEP fixes
This commit is contained in:
parent
75b21bdd8f
commit
6603d6e9ed
@ -285,7 +285,6 @@ class StockList(generics.ListCreateAPIView):
|
||||
# Does the client wish to filter by stock location?
|
||||
loc_id = self.request.query_params.get('location', None)
|
||||
|
||||
|
||||
if loc_id:
|
||||
try:
|
||||
location = StockLocation.objects.get(pk=loc_id)
|
||||
|
@ -122,7 +122,6 @@ class StockItem(models.Model):
|
||||
# ensure that the serial number is unique
|
||||
# across all variants of the same template part
|
||||
|
||||
|
||||
try:
|
||||
if self.serial is not None and self.part.variant_of is not None:
|
||||
if StockItem.objects.filter(part__variant_of=self.part.variant_of, serial=self.serial).exclude(id=self.id).exists():
|
||||
|
@ -208,10 +208,10 @@ class StockItemCreate(AjaxCreateView):
|
||||
|
||||
try:
|
||||
part = Part.objects.get(id=part_id)
|
||||
|
||||
# Hide the 'part' field (as a valid part is selected)
|
||||
form.fields['part'].widget = HiddenInput()
|
||||
|
||||
|
||||
# If the part is NOT purchaseable, hide the supplier_part field
|
||||
if not part.purchaseable:
|
||||
form.fields['supplier_part'].widget = HiddenInput()
|
||||
|
Loading…
x
Reference in New Issue
Block a user