Merge pull request #487 from Unrud/filter

Fix empty filter
This commit is contained in:
Guillaume Ayoub 2016-08-24 18:10:03 +02:00 committed by GitHub
commit c532948348
2 changed files with 5 additions and 1 deletions

View File

@ -267,6 +267,9 @@ class BaseRequestsMixIn:
</C:calendar-query>""" % filters_text) </C:calendar-query>""" % filters_text)
return answer return answer
def test_calendar_empty_filter(self):
self._test_filter([""])
def test_calendar_tag_filter(self): def test_calendar_tag_filter(self):
"""Report request with tag-based filter on calendar.""" """Report request with tag-based filter on calendar."""
assert "href>/calendar.ics/event1.ics</" in self._test_filter([""" assert "href>/calendar.ics/event1.ics</" in self._test_filter(["""

View File

@ -809,7 +809,8 @@ def report(path, xml_request, collection):
match = ( match = (
_comp_match if collection.get_meta("tag") == "VCALENDAR" _comp_match if collection.get_meta("tag") == "VCALENDAR"
else _prop_match) else _prop_match)
if not all(match(item, filter_[0]) for filter_ in filters): if not all(match(item, filter_[0]) for filter_ in filters
if filter_):
continue continue
found_props = [] found_props = []