[CalendarServer-changes] [8014] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Aug 24 19:29:24 PDT 2011
Revision: 8014
http://trac.macosforge.org/projects/calendarserver/changeset/8014
Author: cdaboo at apple.com
Date: 2011-08-24 19:29:22 -0700 (Wed, 24 Aug 2011)
Log Message:
-----------
Handle trailing slash in free-busy-set.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/directory/test/test_calendar.py
CalendarServer/trunk/twistedcaldav/resource.py
Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_calendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/test/test_calendar.py 2011-08-25 01:14:05 UTC (rev 8013)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_calendar.py 2011-08-25 02:29:22 UTC (rev 8014)
@@ -150,3 +150,23 @@
transp = (yield calendar.readProperty(caldavxml.ScheduleCalendarTransp, request))
self.assertEqual(transp, caldavxml.ScheduleCalendarTransp(caldavxml.Transparent()))
+ # Force trailing slash on fbset
+ inbox.writeDeadProperty(caldavxml.CalendarFreeBusySet(
+ davxml.HRef.fromString("/calendars/__uids__/6423F94A-6B76-4A3A-815B-D52CFD77935D/calendar/"),
+ ))
+
+ # Now remove the dead property to simulate the old calendar server state with
+ # a calendar listed in the fbset
+ yield calendar.removeDeadProperty(caldavxml.ScheduleCalendarTransp)
+ fbset = (yield inbox.readProperty(caldavxml.CalendarFreeBusySet, request))
+ self.assertEqual(fbset, caldavxml.CalendarFreeBusySet(
+ davxml.HRef.fromString("/calendars/__uids__/6423F94A-6B76-4A3A-815B-D52CFD77935D/calendar/"),
+ ))
+
+ # Calendar has opaque property derived from inbox
+ transp = (yield calendar.hasProperty(caldavxml.ScheduleCalendarTransp, request))
+ self.assertTrue(transp)
+
+ transp = (yield calendar.readProperty(caldavxml.ScheduleCalendarTransp, request))
+ self.assertEqual(transp, caldavxml.ScheduleCalendarTransp(caldavxml.Opaque()))
+
Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py 2011-08-25 01:14:05 UTC (rev 8013)
+++ CalendarServer/trunk/twistedcaldav/resource.py 2011-08-25 02:29:22 UTC (rev 8014)
@@ -634,7 +634,9 @@
# For backwards compatibility we need to sync this up with the calendar-free-busy-set on the inbox
principal = (yield self.resourceOwnerPrincipal(request))
fbset = (yield principal.calendarFreeBusyURIs(request))
+ fbset = [fburl.rstrip("/") for fburl in fbset]
url = (yield self.canonicalURL(request))
+ url = url.rstrip("/")
opaque = url in fbset
self.writeDeadProperty(caldavxml.ScheduleCalendarTransp(caldavxml.Opaque() if opaque else caldavxml.Transparent()))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110824/0a4047c3/attachment-0001.html>
More information about the calendarserver-changes
mailing list