From 95a09582921d85ad7ac2a7acc197d5725fb23af7 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sun, 26 Oct 2025 16:56:34 +0300 Subject: [PATCH] Features: 1) Enforce LF line endings for `.sh` files using `.gitattributes`; 2) Add filtering of attributes and products based on active status in querysets. Fixes: none; Extra: none; --- .gitattributes | 1 + core/models.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .gitattributes 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, )