[CalendarServer-changes] [10674] CalendarServer/trunk/txdav

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 11 07:20:35 PST 2013


Revision: 10674
          http://trac.calendarserver.org//changeset/10674
Author:   cdaboo at apple.com
Date:     2013-02-11 07:20:35 -0800 (Mon, 11 Feb 2013)
Log Message:
-----------
Fix issue with invalid dropbox-id when updating using an existing managed-id.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/sql.py
    CalendarServer/trunk/txdav/common/datastore/test/util.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py	2013-02-11 15:18:46 UTC (rev 10673)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py	2013-02-11 15:20:35 UTC (rev 10674)
@@ -1577,6 +1577,8 @@
         for managed_id in added:
             changed[managed_id] = newattached[managed_id]
 
+        if self._dropboxID is None:
+            self._dropboxID = str(uuid.uuid4())
         changes = yield self._addingManagedIDs(self._txn, self._parentCollection, self._dropboxID, changed, component.resourceUID())
 
         # Make sure existing data is not changed
@@ -1652,7 +1654,7 @@
         new_attachment = (yield ManagedAttachment.load(txn, managed_id))
         if new_id:
             new_attachment._managedID = new_id
-            new_attachment._objectDropboxID = dropbox_id
+        new_attachment._objectDropboxID = dropbox_id
         for attachment in attachments:
             yield new_attachment.updateProperty(attachment)
 

Modified: CalendarServer/trunk/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/util.py	2013-02-11 15:18:46 UTC (rev 10673)
+++ CalendarServer/trunk/txdav/common/datastore/test/util.py	2013-02-11 15:20:35 UTC (rev 10674)
@@ -225,7 +225,7 @@
         # table' statements are issued, so it's not possible to reference a
         # later table.  Therefore it's OK to drop them in the (reverse) order
         # that they happen to be in.
-        tables = [t.name for t in schema.model.tables
+        tables = [t.name for t in schema.model.tables #@UndefinedVariable
                   # All tables with rows _in_ the schema are populated
                   # exclusively _by_ the schema and shouldn't be manipulated
                   # while the server is running, so we leave those populated.
@@ -415,14 +415,17 @@
     yield populateTxn.commit()
 
 
+
 def updateToCurrentYear(data):
     """
     Update the supplied iCalendar data so that all dates are updated to the current year.
     """
 
     nowYear = PyCalendarDateTime.getToday().getYear()
-    return data % {"now":nowYear}
+    return data % {"now": nowYear}
 
+
+
 @inlineCallbacks
 def resetCalendarMD5s(md5s, store):
     """
@@ -453,6 +456,7 @@
     yield populateTxn.commit()
 
 
+
 @inlineCallbacks
 def populateAddressBooksFrom(requirements, store):
     """
@@ -488,6 +492,8 @@
                         )
     yield populateTxn.commit()
 
+
+
 @inlineCallbacks
 def resetAddressBookMD5s(md5s, store):
     """
@@ -518,6 +524,7 @@
     yield populateTxn.commit()
 
 
+
 def assertProvides(testCase, interface, provider):
     """
     Verify that C{provider} properly provides C{interface}
@@ -618,6 +625,7 @@
             return succeed(True)
 
 
+
 class StubNotifierFactory(object):
     """
     For testing push notifications without an XMPP server.
@@ -633,12 +641,15 @@
             "port" : "123",
         }
 
+
     def newNotifier(self, label="default", id=None, prefix=None):
         return Notifier(self, label=label, id=id, prefix=prefix)
 
+
     def send(self, op, id):
         self.history.append((op, id))
 
+
     def reset(self):
         self.history = []
 
@@ -659,5 +670,3 @@
     aTest.patch(config.Memcached.Pools.Default, "ClientEnabled", False)
     aTest.patch(config.Memcached.Pools.Default, "ServerEnabled", False)
     aTest.patch(Memcacher, "allowTestCache", True)
-
-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130211/75c4ff8d/attachment-0001.html>


More information about the calendarserver-changes mailing list