[CalendarServer-changes] [446] CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 13 19:08:30 PST 2006


Revision: 446
          http://trac.macosforge.org/projects/calendarserver/changeset/446
Author:   wsanchez at apple.com
Date:     2006-11-13 19:08:29 -0800 (Mon, 13 Nov 2006)

Log Message:
-----------
Fix calendar home location for principals

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py
    CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/static.py

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py	2006-11-14 02:49:31 UTC (rev 445)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py	2006-11-14 03:08:29 UTC (rev 446)
@@ -256,7 +256,7 @@
         # FIXME: self.directory.calendarHomesCollection smells like a hack
         # See CalendarHomeProvisioningFile.__init__()
         return (
-            self.record.service.calendarHomesCollection.url(),
+            self.record.service.calendarHomesCollection.homeForDirectoryRecord(self.record).url(),
         )
 
     def calendarUserAddresses(self):

Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/static.py	2006-11-14 02:49:31 UTC (rev 445)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/static.py	2006-11-14 03:08:29 UTC (rev 446)
@@ -464,6 +464,9 @@
         # See DirectoryPrincipalProvisioningResource.__init__()
         return self.directory.principalCollection.principalCollections(request)
 
+    def homeForDirectoryRecord(self, record):
+        return self.getChild(record.recordType).getChild(record.shortName)
+
 class CalendarHomeTypeProvisioningFile (ReadOnlyResourceMixIn, DAVFile):
     """
     L{CalDAVFile} resource which provisions calendar home collections of a specific
@@ -481,6 +484,9 @@
         self.recordType = recordType
         self._parent = parent
 
+    def url(self):
+        return joinURL(self._parent.url(), self.recordType)
+
     def createSimilarFile(self, path):
         raise HTTPError(responsecode.NOT_FOUND)
 
@@ -539,6 +545,9 @@
             if not child_fp.exists(): child_fp.makedirs()
             self.putChild(name, cls(child_fp.path))
 
+    def url(self):
+        return joinURL(self._parent.url(), self.record.shortName)
+
     def createSimilarFile(self, path):
         if path == self.fp.path:
             return self

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061113/1438a9d9/attachment.html


More information about the calendarserver-changes mailing list