mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Peppy fixes
This commit is contained in:
parent
00c21d521e
commit
2202dfd55d
@ -3,7 +3,6 @@ dist: xenial
|
||||
language: python
|
||||
python:
|
||||
- 3.5
|
||||
- 3.6
|
||||
|
||||
addons:
|
||||
apt-packages:
|
||||
|
@ -67,7 +67,6 @@ class PartDetail(DraftRUDView):
|
||||
|
||||
class PartList(generics.ListCreateAPIView):
|
||||
|
||||
#queryset = Part.objects.all()
|
||||
serializer_class = PartSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
@ -86,11 +85,13 @@ class PartList(generics.ListCreateAPIView):
|
||||
if self.request.query_params.get('include_child_categories', None):
|
||||
childs = category.getUniqueChildren()
|
||||
for child in childs:
|
||||
if child == cat_id: continue
|
||||
# Ignore the top-level category (already filtered)
|
||||
if child == cat_id:
|
||||
continue
|
||||
flt |= Q(category=child)
|
||||
|
||||
return Part.objects.filter(flt)
|
||||
|
||||
|
||||
# Default - return all parts
|
||||
return Part.objects.all()
|
||||
|
||||
@ -105,7 +106,6 @@ class PartList(generics.ListCreateAPIView):
|
||||
]
|
||||
|
||||
filter_fields = [
|
||||
#'category',
|
||||
]
|
||||
|
||||
ordering_fields = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user