Skip to content

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

Clarify NoValidationSearchVector init normalization (#18859)

Iga Karbowiakcfed156ae27a
diff --git a/saleor/core/postgres.py b/saleor/core/postgres.py
index dd6080213a..15eec4ec2a 100644
--- a/saleor/core/postgres.py
+++ b/saleor/core/postgres.py
@@ -44,14 +44,15 @@ class NoValidationSearchVector(SearchVector, NoValidationSearchVectorCombinable)
and/or over clause.
"""
- def __init__(self, *expressions, **kwargs):
+ def __init__(self, *expressions, config=None, weight=None):
processed = []
for expr in expressions:
if isinstance(expr, Value) and isinstance(expr.value, str):
+ # Normalize only string literals to make search accent-insensitive.
processed.append(Value(strip_accents(expr.value)))
else:
processed.append(expr)
- super().__init__(*processed, **kwargs)
+ super().__init__(*processed, config=config, weight=weight)
class FlatConcat(Expression):