Skip to content

Commit

Permalink
Handle lists in filter values for CATEGORIES
Browse files Browse the repository at this point in the history
Issue Kozea#1125

Signed-off-by: David Greaves <[email protected]>
  • Loading branch information
lbt authored and Unrud committed Mar 5, 2023
1 parent 11a2b43 commit 7b98a00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion radicale/item/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,15 @@ def match(value: str) -> bool:
match(attrib) for child in children
for attrib in child.params.get(attrib_name, []))
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":
return not condition
return condition
Expand Down

0 comments on commit 7b98a00

Please sign in to comment.