Explorar o código

Merge pull request #487 from Unrud/filter

Fix empty filter
Guillaume Ayoub %!s(int64=9) %!d(string=hai) anos
pai
achega
c532948348
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  1. 3 0
      radicale/tests/test_base.py
  2. 2 1
      radicale/xmlutils.py

+ 3 - 0
radicale/tests/test_base.py

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

+ 2 - 1
radicale/xmlutils.py

@@ -809,7 +809,8 @@ def report(path, xml_request, collection):
                 match = (
                     _comp_match if collection.get_meta("tag") == "VCALENDAR"
                     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
 
             found_props = []