[CalendarServer-changes] [9544] CalendarServer/branches/users/gaya/inviteclean/txdav/common/ datastore/sql.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 8 13:47:04 PDT 2012


Revision: 9544
          http://trac.macosforge.org/projects/calendarserver/changeset/9544
Author:   gaya at apple.com
Date:     2012-08-08 13:47:04 -0700 (Wed, 08 Aug 2012)
Log Message:
-----------
add check for all binds in CommonHomeChild.create()

Modified Paths:
--------------
    CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py

Modified: CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py	2012-08-08 20:46:13 UTC (rev 9543)
+++ CalendarServer/branches/users/gaya/inviteclean/txdav/common/datastore/sql.py	2012-08-08 20:47:04 UTC (rev 9544)
@@ -2272,7 +2272,7 @@
         )
 
     @classproperty
-    def _acceptedBindForResourceID(cls): #@NoSelf
+    def _sharedBindForResourceID(cls): #@NoSelf
         bind = cls._bindSchema
         return cls._bindFor((bind.RESOURCE_ID == Parameter("resourceID"))
                             .And(bind.BIND_STATUS == _BIND_STATUS_ACCEPTED)
@@ -2294,7 +2294,7 @@
         @rtype: a L{Deferred} which fires with a L{list} of L{ICalendar}s.
         """
         # get all accepted binds
-        acceptedRows = yield self._acceptedBindForResourceID.on(self._txn, resourceID=self._resourceID)
+        acceptedRows = yield self._sharedBindForResourceID.on(self._txn, resourceID=self._resourceID)
 
         cls = self.__class__ # for ease of grepping...
         result = []
@@ -2597,6 +2597,9 @@
         child = (yield cls.objectWithName(home, name))
         if child is not None:
             raise HomeChildNameAlreadyExistsError(name)
+        invite = (yield cls.invitedObjectWithName(home, name))
+        if invite is not None:
+            raise HomeChildNameAlreadyExistsError(name)
 
         if name.startswith("."):
             raise HomeChildNameNotAllowedError(name)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120808/fb259d4d/attachment-0001.html>


More information about the calendarserver-changes mailing list