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;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-10-26 16:56:34 +03:00
parent 8d2ce5b013
commit 95a0958292
2 changed files with 5 additions and 0 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
*.sh text eol=lf

View file

@ -354,7 +354,9 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel): #
rows = ( rows = (
AttributeValue.objects.annotate(value_length=Length("value")) AttributeValue.objects.annotate(value_length=Length("value"))
.filter( .filter(
product__is_active=True,
product__category_id__in=cat_ids, product__category_id__in=cat_ids,
attribute__is_active=True,
attribute__is_filterable=True, attribute__is_filterable=True,
value_length__lte=30, value_length__lte=30,
) )
@ -394,7 +396,9 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel): #
rows = ( rows = (
AttributeValue.objects.annotate(value_length=Length("value")) AttributeValue.objects.annotate(value_length=Length("value"))
.filter( .filter(
product__is_active=True,
product__category=self, product__category=self,
attribute__is_active=True,
attribute__is_filterable=True, attribute__is_filterable=True,
value_length__lte=30, value_length__lte=30,
) )