Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix Price filtering label

Pacu2cc47bcbcb713
diff --git a/saleor/product/filters.py b/saleor/product/filters.py
index e075cc0cc1..c82e9a65bb 100644
--- a/saleor/product/filters.py
+++ b/saleor/product/filters.py
@@ -19,11 +19,12 @@ class ProductFilter(SortedFilterSet):
label=pgettext_lazy('Product list sorting form', 'Sort by'),
fields=SORT_BY_FIELDS.keys(),
field_labels=SORT_BY_FIELDS)
+ price = RangeFilter(
+ label=pgettext_lazy('Currency amount', 'Price'))
class Meta:
model = Product
- fields = ['price']
- filter_overrides = {MoneyField: {'filter_class': RangeFilter}}
+ fields = []
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
diff --git a/saleor/product/models.py b/saleor/product/models.py
index aca28219ba..fd8103eea2 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -103,8 +103,7 @@ class Product(SeoModel):
Category, related_name='products', on_delete=models.CASCADE)
price = MoneyField(
currency=settings.DEFAULT_CURRENCY, max_digits=12,
- decimal_places=settings.DEFAULT_DECIMAL_PLACES,
- verbose_name=pgettext_lazy('Currency amount', 'Price'))
+ decimal_places=settings.DEFAULT_DECIMAL_PLACES)
available_on = models.DateField(blank=True, null=True)
is_published = models.BooleanField(default=True)
attributes = HStoreField(default={}, blank=True)