[CalendarServer-changes] [844] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 15 19:20:11 PST 2006


Revision: 844
          http://trac.macosforge.org/projects/calendarserver/changeset/844
Author:   wsanchez at apple.com
Date:     2006-12-15 19:20:11 -0800 (Fri, 15 Dec 2006)

Log Message:
-----------
Always call super's provision()

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/calendar.py
    CalendarServer/trunk/twistedcaldav/static.py

Modified: CalendarServer/trunk/twistedcaldav/directory/calendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/calendar.py	2006-12-16 02:56:53 UTC (rev 843)
+++ CalendarServer/trunk/twistedcaldav/directory/calendar.py	2006-12-16 03:20:11 UTC (rev 844)
@@ -26,6 +26,7 @@
     "DirectoryCalendarHomeResource",
 ]
 
+from twisted.internet.defer import succeed
 from twisted.web2.dav import davxml
 from twisted.web2.dav.util import joinURL
 from twisted.web2.dav.resource import TwistedACLInheritable, TwistedQuotaRootProperty
@@ -63,7 +64,7 @@
             # Create children
             for recordType in self.directory.recordTypes():
                 self.putChild(recordType, self.provisionChild(recordType))
-            return super(DirectoryCalendarHomeProvisioningResource, self).provision()
+        return super(DirectoryCalendarHomeProvisioningResource, self).provision()
 
     def provisionChild(self, recordType):
         raise NotImplementedError("Subclass must implement provisionChild()")
@@ -205,6 +206,9 @@
         child = self.provisionChild(childName)
         assert isinstance(child, CalDAVResource), "Child %r is not a %s: %r" % (childName, CalDAVResource.__name__, child)
 
+        if child.exists():
+            return succeed(None)
+
         def setupChild(_):
             # Grant read-free-busy access to authenticated users
             child.setAccessControlList(

Modified: CalendarServer/trunk/twistedcaldav/static.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/static.py	2006-12-16 02:56:53 UTC (rev 843)
+++ CalendarServer/trunk/twistedcaldav/static.py	2006-12-16 03:20:11 UTC (rev 844)
@@ -363,8 +363,8 @@
 
 class AutoProvisioningFileMixIn (AutoProvisioningResourceMixIn):
     def provision(self):
-        if self.provisionFile():
-            return super(AutoProvisioningFileMixIn, self).provision()
+        self.provisionFile()
+        return super(AutoProvisioningFileMixIn, self).provision()
 
     def provisionFile(self):
         fp = self.fp
@@ -519,7 +519,7 @@
                 # since they typically don't have someone responding for them.
                 self.writeDeadProperty(customxml.TwistedScheduleAutoRespond())
 
-            return super(ScheduleInboxFile, self).provision()
+        return super(ScheduleInboxFile, self).provision()
 
     def __repr__(self):
         return "<%s (calendar inbox collection): %s>" % (self.__class__.__name__, self.fp.path)

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


More information about the calendarserver-changes mailing list