Revision
1481
Author
cdaboo@apple.com
Date
2007-04-12 09:53:08 -0700 (Thu, 12 Apr 2007)

Log Message

Make sure empty queries return nothing.

Modified Paths

Diff

Modified: CalendarServer/trunk/twistedcaldav/method/report_calquery.py (1480 => 1481)


--- CalendarServer/trunk/twistedcaldav/method/report_calquery.py	2007-04-12 16:51:47 UTC (rev 1480)
+++ CalendarServer/trunk/twistedcaldav/method/report_calquery.py	2007-04-12 16:53:08 UTC (rev 1481)
@@ -153,6 +153,9 @@
             
                 # Get list of children that match the search and have read access
                 names = [name for name, ignore_uid, ignore_type in calresource.index().search(filter)]
+                if not names:
+                    yield None
+                    return
                   
                 # Now determine which valid resources are readable and which are not
                 ok_resources = []

Modified: CalendarServer/trunk/twistedcaldav/method/report_multiget.py (1480 => 1481)


--- CalendarServer/trunk/twistedcaldav/method/report_multiget.py	2007-04-12 16:51:47 UTC (rev 1480)
+++ CalendarServer/trunk/twistedcaldav/method/report_multiget.py	2007-04-12 16:53:08 UTC (rev 1481)
@@ -149,6 +149,9 @@
                     responses.append(davxml.StatusResponse(href, davxml.Status.fromResponseCode(responsecode.NOT_ALLOWED)))
                 else:
                     checked_names.append(name)
+            if not checked_names:
+                yield None
+                return
             
             # Now determine which valid resources are readable and which are not
             ok_resources = []