fix(chalice): support session's search null duration (#2806)

(cherry picked from commit e7ad4c8bd0)
This commit is contained in:
Kraiem Taha Yassine 2024-12-03 13:24:24 +01:00 committed by Taha Yassine Kraiem
parent 4ec2dbfeca
commit 9d740c7bb2

View file

@ -754,6 +754,8 @@ class SessionsSearchPayloadSchema(_TimedSchema, _PaginatedSchema):
for f in values.get("filters", []):
vals = []
for v in f.get("value", []):
if f.get("type", "") == FilterType.DURATION.value and v is None:
v = 0
if v is not None and (f.get("type", "") != FilterType.DURATION.value
or str(v).isnumeric()):
vals.append(v)