diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..526c8a38 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf \ No newline at end of file diff --git a/core/models.py b/core/models.py index 5617bf92..b539c011 100644 --- a/core/models.py +++ b/core/models.py @@ -354,7 +354,9 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel): # rows = ( AttributeValue.objects.annotate(value_length=Length("value")) .filter( + product__is_active=True, product__category_id__in=cat_ids, + attribute__is_active=True, attribute__is_filterable=True, value_length__lte=30, ) @@ -394,7 +396,9 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel): # rows = ( AttributeValue.objects.annotate(value_length=Length("value")) .filter( + product__is_active=True, product__category=self, + attribute__is_active=True, attribute__is_filterable=True, value_length__lte=30, )