[CalendarServer-changes] [5327] CalendarServer/branches/users/cdaboo/shared-calendars-5187/ twistedcaldav/sharing.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 16 18:42:34 PDT 2010


Revision: 5327
          http://trac.macosforge.org/projects/calendarserver/changeset/5327
Author:   cdaboo at apple.com
Date:     2010-03-16 18:42:30 -0700 (Tue, 16 Mar 2010)
Log Message:
-----------
Allow empty calendars to be upgraded to sharing.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/shared-calendars-5187/twistedcaldav/sharing.py

Modified: CalendarServer/branches/users/cdaboo/shared-calendars-5187/twistedcaldav/sharing.py
===================================================================
--- CalendarServer/branches/users/cdaboo/shared-calendars-5187/twistedcaldav/sharing.py	2010-03-16 21:51:57 UTC (rev 5326)
+++ CalendarServer/branches/users/cdaboo/shared-calendars-5187/twistedcaldav/sharing.py	2010-03-17 01:42:30 UTC (rev 5327)
@@ -68,7 +68,8 @@
         """ Upgrade this collection to a shared state """
         
         # For calendars we only allow upgrades is shared-scheduling is on
-        if request.method not in ("MKCALENDAR", "MKCOL") and self.isCalendarCollection() and not config.Sharing.Calendars.AllowScheduling:
+        if request.method not in ("MKCALENDAR", "MKCOL") and self.isCalendarCollection() and \
+            not config.Sharing.Calendars.AllowScheduling and len(self.listChildren()) != 0:
             raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Cannot upgrade to shared calendar"))
 
         # Change resourcetype
@@ -513,7 +514,7 @@
 
             def _autoShare(isShared, request):
                 if not isShared:
-                    if not self.isCalendarCollection() or config.Sharing.Calendars.AllowScheduling:
+                    if not self.isCalendarCollection() or config.Sharing.Calendars.AllowScheduling or len(self.listChildren()) == 0:
                         return self.upgradeToShare(request)
                 else:
                     return succeed(True)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100316/1dd6ecb7/attachment.html>


More information about the calendarserver-changes mailing list