Fixes: get_descendants -> get_ancestors
This commit is contained in:
parent
e7836ebf90
commit
2d1092eb7c
1 changed files with 2 additions and 2 deletions
|
|
@ -180,7 +180,7 @@ class ProductFilter(FilterSet):
|
|||
return queryset
|
||||
|
||||
include = self.data.get("include_subcategories")
|
||||
include_children = str(include).lower() in ("1", "true", "t", "yes")
|
||||
include_children = str(include).lower() in ("1", "true", "t", "yes", "y")
|
||||
|
||||
try:
|
||||
root = Category.objects.get(uuid=value)
|
||||
|
|
@ -188,7 +188,7 @@ class ProductFilter(FilterSet):
|
|||
return queryset.none()
|
||||
|
||||
if include_children:
|
||||
descendants = root.get_descendants(include_self=True)
|
||||
descendants = root.get_ancestors(include_self=True)
|
||||
return queryset.filter(category__in=descendants)
|
||||
else:
|
||||
return queryset.filter(category__uuid=value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue