mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
PEP
This commit is contained in:
parent
79cd05423c
commit
ea0da4c8f8
@ -180,7 +180,7 @@ class InvenTreeTree(models.Model):
|
|||||||
# Parent cannot be set to same ID (this would cause looping)
|
# Parent cannot be set to same ID (this would cause looping)
|
||||||
try:
|
try:
|
||||||
if self.parent.id == self.id:
|
if self.parent.id == self.id:
|
||||||
raise ValidationError("Category cannot set itself as parent")
|
raise ValidationError("Category cannot set itself as parent")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -135,7 +135,6 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
# TODO - Annotate total being built
|
# TODO - Annotate total being built
|
||||||
# TODO - Annotate total on order
|
# TODO - Annotate total on order
|
||||||
# TODO - Annotate
|
|
||||||
|
|
||||||
# Reduce the number of lookups we need to do for the part categories
|
# Reduce the number of lookups we need to do for the part categories
|
||||||
categories = {}
|
categories = {}
|
||||||
@ -155,9 +154,7 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
else:
|
else:
|
||||||
item['category__name'] = None
|
item['category__name'] = None
|
||||||
|
|
||||||
|
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user