[CalendarServer-changes] [1606] CalendarServer/trunk/twistedcaldav/method/report_calquery.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 18 12:20:22 PDT 2007


Revision: 1606
          http://trac.macosforge.org/projects/calendarserver/changeset/1606
Author:   cdaboo at apple.com
Date:     2007-06-18 12:20:21 -0700 (Mon, 18 Jun 2007)

Log Message:
-----------
Make sure encoded URIs do not cause 500 errors in query reports.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/method/report_calquery.py

Modified: CalendarServer/trunk/twistedcaldav/method/report_calquery.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_calquery.py	2007-06-18 18:28:06 UTC (rev 1605)
+++ CalendarServer/trunk/twistedcaldav/method/report_calquery.py	2007-06-18 19:20:21 UTC (rev 1606)
@@ -35,6 +35,8 @@
 from twistedcaldav.caldavxml import caldav_namespace
 from twistedcaldav.method import report_common
 
+import urllib
+
 max_number_of_results = 1000
 
 def report_urn_ietf_params_xml_ns_caldav_calendar_query(self, request, calendar_query):
@@ -174,15 +176,16 @@
                 x.getResult()
                 
                 for child, child_uri in ok_resources:
-                    child_name = child_uri[child_uri.rfind("/") + 1:]
+                    child_uri_name = child_uri[child_uri.rfind("/") + 1:]
+                    child_path_name = urllib.unquote(child_uri_name)
                     
                     if generate_calendar_data or not index_query_ok:
-                        calendar = calresource.iCalendar(child_name)
-                        assert calendar is not None, "Calendar %s is missing from calendar collection %r" % (child_name, self)
+                        calendar = calresource.iCalendar(child_path_name)
+                        assert calendar is not None, "Calendar %s is missing from calendar collection %r" % (child_uri_name, self)
                     else:
                         calendar = None
                     
-                    d = waitForDeferred(queryCalendarObjectResource(child, uri, child_name, calendar, query_ok = index_query_ok))
+                    d = waitForDeferred(queryCalendarObjectResource(child, uri, child_uri_name, calendar, query_ok = index_query_ok))
                     yield d
                     d.getResult()
         else:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070618/5ed7448c/attachment.html


More information about the calendarserver-changes mailing list