Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename standard_form
michalfda0b6645e9d
diff --git a/saleor/product/filters.py b/saleor/product/filters.pyindex 390709b338..de146ad193 100644--- a/saleor/product/filters.py+++ b/saleor/product/filters.py@@ -53,7 +53,7 @@ class ProductFilter(FilterSet):}@property- def standard_form(self):+ def product_attributes_filter_form(self):"""This method returns only those filters that ware dynamically generatedin __init__().@@ -61,10 +61,10 @@ class ProductFilter(FilterSet):than rest of the filters.:return:"""- standard_form = deepcopy(self.form)- del standard_form.fields['price']- del standard_form.fields['sort_by']- return standard_form+ form = deepcopy(self.form)+ del form.fields['price']+ del form.fields['sort_by']+ return formdef get_attribute_choices(attribute):diff --git a/templates/category/index.html b/templates/category/index.htmlindex ccdd576ce0..bb258dc438 100644--- a/templates/category/index.html+++ b/templates/category/index.html@@ -97,7 +97,7 @@<div class="product-filters"><div class="product-filters__attributes" data-icon-up="{% static "assets/chevron_up.svg" %}" data-icon-down="{% static "assets/chevron_down.svg" %}"><form method="get">- {% for field in filter.standard_form %}+ {% for field in filter.product_attributes_filter_form %}<div class="toggle-filter"><h3 class="filter-label">{{ field.label }}diff --git a/tests/test_product.py b/tests/test_product.pyindex a335925645..fc515ff28e 100644--- a/tests/test_product.py+++ b/tests/test_product.py@@ -424,7 +424,7 @@ def test_product_filter_standard_form(authorized_client, product_in_stock,data = {'price_0': [''], 'price_1': ['20']}response = authorized_client.get(url, data)assert 'price' not in \- response.context['filter'].standard_form.fields.keys()+ response.context['filter'].product_attributes_filter_form.fields.keys()assert 'sort_by' not in \- response.context['filter'].standard_form.fields.keys()+ response.context['filter'].product_attributes_filter_form.fields.keys()assert list(response.context['filter'].qs) == list(products)