[CalendarServer-changes] [8328] CalendarServer/branches/users/glyph/multiget-delete/txdav/common/ datastore/sql.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Nov 18 10:14:20 PST 2011


Revision: 8328
          http://trac.macosforge.org/projects/calendarserver/changeset/8328
Author:   glyph at apple.com
Date:     2011-11-18 10:14:20 -0800 (Fri, 18 Nov 2011)
Log Message:
-----------
fix the sql implementation to explicitly detect 0 rows in text query

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/multiget-delete/txdav/common/datastore/sql.py

Modified: CalendarServer/branches/users/glyph/multiget-delete/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/multiget-delete/txdav/common/datastore/sql.py	2011-11-18 18:14:09 UTC (rev 8327)
+++ CalendarServer/branches/users/glyph/multiget-delete/txdav/common/datastore/sql.py	2011-11-18 18:14:20 UTC (rev 8328)
@@ -75,6 +75,7 @@
 from txdav.base.propertystore.none import PropertyStore as NonePropertyStore
 from txdav.base.propertystore.sql import PropertyStore
 
+from txdav.common.icommondatastore import ConcurrentModification
 from twistedcaldav.customxml import NotificationType
 from twistedcaldav.dateops import datetimeMktime, parseSQLTimestamp,\
     pyCalendarTodatetime
@@ -2590,12 +2591,16 @@
     @inlineCallbacks
     def _text(self):
         if self._objectText is None:
-            text = (
+            texts = (
                 yield self._textByIDQuery.on(self._txn,
                                              resourceID=self._resourceID)
-            )[0][0]
-            self._objectText = text
-            returnValue(text)
+            )
+            if texts:
+                text = texts[0][0]
+                self._objectText = text
+                returnValue(text)
+            else:
+                raise ConcurrentModification()
         else:
             returnValue(self._objectText)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111118/f95dd666/attachment.html>


More information about the calendarserver-changes mailing list