From 7b98a0028b0e9b4b75a8a6a3ff092a738e5d68b4 Mon Sep 17 00:00:00 2001 From: David Greaves Date: Fri, 20 Jan 2023 15:30:49 +0000 Subject: [PATCH] Handle lists in filter values for CATEGORIES Issue #1125 Signed-off-by: David Greaves --- radicale/item/filter.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/radicale/item/filter.py b/radicale/item/filter.py index 587dc367..6a89ffa3 100644 --- a/radicale/item/filter.py +++ b/radicale/item/filter.py @@ -468,7 +468,15 @@ def text_match(vobject_item: vobject.base.Component, 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