diff --git a/.travis.yml b/.travis.yml index 82bc201184..09f5fa6f2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ dist: xenial language: python python: - 3.5 - - 3.6 addons: apt-packages: diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index e119188def..024d61a4a5 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -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 = [