[CalendarServer-changes] [13574] CalendarServer/trunk/txdav/caldav/datastore

source_changes at macosforge.org source_changes at macosforge.org
Fri May 30 09:24:59 PDT 2014


Revision: 13574
          http://trac.calendarserver.org//changeset/13574
Author:   cdaboo at apple.com
Date:     2014-05-30 09:24:59 -0700 (Fri, 30 May 2014)
Log Message:
-----------
Make sure events without instances can be stored when group expansion is enabled.

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

Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py	2014-05-30 15:50:38 UTC (rev 13573)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py	2014-05-30 16:24:59 UTC (rev 13574)
@@ -2061,7 +2061,7 @@
                 isOld = rows[0][0] == 0
 
             else:
-                if instances:
+                if instances and len(instances.instances):
                     cutoffDate_DateTime = (
                         DateTime.getNowUTC() +
                         Duration(seconds=config.GroupAttendees.UpdateOldEventLimitSeconds)

Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py	2014-05-30 15:50:38 UTC (rev 13573)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py	2014-05-30 16:24:59 UTC (rev 13574)
@@ -2277,7 +2277,43 @@
         yield self.commit()
 
 
+    @inlineCallbacks
+    def test_setComponent_noInstances(self):
+        """
+        Verify that an event with no instances (entirely EXDATEd) can be stored when group expansion
+        is on.
+        """
 
+        self.patch(config.GroupAttendees, "Enabled", True)
+
+        data = """BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+PRODID:-//Apple Inc.//Mac OS X 10.9.1//EN
+BEGIN:VEVENT
+UID:561F5DBB-3F38-4B3A-986F-DD05CBAF554F
+DTSTART;TZID=America/Los_Angeles:20131211T164500
+DURATION:PT1H
+ATTENDEE:urn:x-uid:user01
+CREATED:20131211T221854Z
+DTSTAMP:20131211T230632Z
+ORGANIZER:urn:x-uid:user01
+RRULE:FREQ=DAILY;COUNT=1
+EXDATE;TZID=America/Los_Angeles:20131211T164500
+SUMMARY:external
+END:VEVENT
+END:VCALENDAR
+""".replace("\n", "\r\n")
+
+        calendar = yield self.calendarUnderTest(name="calendar", home="user01")
+        yield calendar.createCalendarObjectWithName("exdated.ics", Component.fromString(data))
+        yield self.commit()
+
+        cobj = yield self.calendarObjectUnderTest(name="exdated.ics", calendar_name="calendar", home="user01")
+        self.assertTrue(cobj is not None)
+
+
+
 class CalendarObjectSplitting(CommonCommonTests, unittest.TestCase):
     """
     CalendarObject splitting tests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140530/76ffa673/attachment.html>


More information about the calendarserver-changes mailing list