feat(api): sessions-search-value-helper fixed value-operator for non-string-values

This commit is contained in:
Taha Yassine Kraiem 2022-03-23 12:17:08 +01:00
parent eee68d53d5
commit 979e76321b

View file

@ -213,11 +213,11 @@ def values_for_operator(value: Union[str, list], op: schemas.SearchEventOperator
if value is None:
return value
if op == schemas.SearchEventOperator._starts_with:
return value + '%'
return f"{value}%"
elif op == schemas.SearchEventOperator._ends_with:
return '%' + value
return f"%{value}"
elif op == schemas.SearchEventOperator._contains or op == schemas.SearchEventOperator._not_contains:
return '%' + value + '%'
return f"%{value}%"
return value