Handle lists in filter values for CATEGORIES
Issue #1125 Signed-off-by: David Greaves <david@dgreaves.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user