[CalendarServer-changes] [2838] CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ schedule.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 20 12:48:18 PDT 2008


Revision: 2838
          http://trac.macosforge.org/projects/calendarserver/changeset/2838
Author:   cdaboo at apple.com
Date:     2008-08-20 12:48:18 -0700 (Wed, 20 Aug 2008)
Log Message:
-----------
Always normalize the URIs going into the free-busy-set property.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/schedule.py

Modified: CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/schedule.py	2008-08-20 19:47:53 UTC (rev 2837)
+++ CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/schedule.py	2008-08-20 19:48:18 UTC (rev 2838)
@@ -30,7 +30,7 @@
 from twisted.web2.dav.http import ErrorResponse
 from twisted.web2.dav.idav import IDAVResource
 from twisted.web2.dav.resource import AccessDeniedError
-from twisted.web2.dav.util import joinURL
+from twisted.web2.dav.util import joinURL, normalizeURL
 from twisted.web2.http import HTTPError
 from twisted.web2.http import Response
 from twisted.web2.http_headers import MimeType
@@ -154,6 +154,7 @@
 
         elif property.qname() == (caldav_namespace, "schedule-default-calendar-URL"):
             # Verify that the calendar added in the PROPPATCH is valid.
+            property.children = [davxml.HRef(normalizeURL(str(href))) for href in property.children]
             new_calendar = [str(href) for href in property.children]
             if len(new_calendar) == 1:
                 cal = (yield request.locateResource(str(new_calendar[0])))
@@ -167,10 +168,12 @@
         yield super(ScheduleInboxResource, self).writeProperty(property, request)
 
     def processFreeBusyCalendar(self, uri, addit):
+        uri = normalizeURL(uri)
+
         if not self.hasDeadProperty((caldav_namespace, "calendar-free-busy-set")):
             fbset = set()
         else:
-            fbset = set([str(href) for href in self.readDeadProperty((caldav_namespace, "calendar-free-busy-set")).children])
+            fbset = set([normalizeURL(str(href)) for href in self.readDeadProperty((caldav_namespace, "calendar-free-busy-set")).children])
         if addit:
             if uri not in fbset:
                 fbset.add(uri)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080820/850556d3/attachment.html 


More information about the calendarserver-changes mailing list