1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

Handle lists in filter values for CATEGORIES

Issue #1125

Signed-off-by: David Greaves <david@dgreaves.com>
This commit is contained in:
David Greaves 2023-01-20 15:30:49 +00:00 committed by Unrud
parent 11a2b43b60
commit 7b98a0028b

View file

@ -468,7 +468,15 @@ def text_match(vobject_item: vobject.base.Component,
match(attrib) for child in children match(attrib) for child in children
for attrib in child.params.get(attrib_name, [])) for attrib in child.params.get(attrib_name, []))
else: else:
condition = any(match(child.value) for child in children) res = []
for child in children:
# Some filters such as CATEGORIES provide a list in child.value
if type(child.value) is list:
for value in child.value:
res.append(match(value))
else:
res.append(match(child.value))
condition = any(res)
if filter_.get("negate-condition") == "yes": if filter_.get("negate-condition") == "yes":
return not condition return not condition
return condition return condition