[CalendarServer-changes] [14467] CalendarServer/branches/users/sagen/trashcan-4/txdav

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 23 10:03:06 PST 2015


Revision: 14467
          http://trac.calendarserver.org//changeset/14467
Author:   sagen at apple.com
Date:     2015-02-23 10:03:06 -0800 (Mon, 23 Feb 2015)
Log Message:
-----------
When a restored event is split, update the attendee's copies of the ongoing half.

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/trashcan-4/txdav/caldav/datastore/sql.py
    CalendarServer/branches/users/sagen/trashcan-4/txdav/common/datastore/test/test_sql.py

Modified: CalendarServer/branches/users/sagen/trashcan-4/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-4/txdav/caldav/datastore/sql.py	2015-02-23 17:56:13 UTC (rev 14466)
+++ CalendarServer/branches/users/sagen/trashcan-4/txdav/caldav/datastore/sql.py	2015-02-23 18:03:06 UTC (rev 14467)
@@ -4913,12 +4913,18 @@
             splitter = iCalSplitter()
             willSplit = splitter.willSplit(caldata)
             if willSplit:
-                newPastResource = yield self.split(
+                yield self.split(
                     coercePartstatsInExistingResource=True,
                     splitter=splitter
                 )
                 # original resource is the ongoing one,
                 # the new resource is the past one
+
+                # Update the attendee's copy of the ongoing one
+                yield ImplicitScheduler().refreshAllAttendeesExceptSome(
+                    self._txn,
+                    self,
+                )
             else:
                 now = DateTime.getNowUTC()
                 now.setHHMMSS(0, 0, 0)

Modified: CalendarServer/branches/users/sagen/trashcan-4/txdav/common/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-4/txdav/common/datastore/test/test_sql.py	2015-02-23 17:56:13 UTC (rev 14466)
+++ CalendarServer/branches/users/sagen/trashcan-4/txdav/common/datastore/test/test_sql.py	2015-02-23 18:03:06 UTC (rev 14467)
@@ -1157,19 +1157,14 @@
         data = yield self._getResourceData(txn, "user01", "calendar", newName)
         self.assertTrue("RRULE:FREQ=WEEKLY;UNTIL=" in data)
 
-        # user02's copy should be back on their calendar
+        # user02's copy should be back on their calendar, and not in trash
 
         resourceNames = yield self._getResourceNames(txn, "user02", "calendar")
-        print("user02's calendar", resourceNames)
+        self.assertEquals(len(resourceNames), 1)
         resourceNames = yield self._getResourceNames(txn, "user02", "trash")
-        print("user02's trash", resourceNames)
+        self.assertEquals(len(resourceNames), 0)
 
         data = yield self._getResourceData(txn, "user02", "calendar", "")
-        print("user02 copy")
-        if data is None:
-            print("Resource not found")
-        else:
-            print(data)
         self.assertTrue("PARTSTAT=NEEDS-ACTION" in data)
 
         yield txn.commit()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150223/5a649db8/attachment.html>


More information about the calendarserver-changes mailing list