[CalendarServer-changes] [13589] CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav /datastore/scheduling

source_changes at macosforge.org source_changes at macosforge.org
Sun Jun 1 17:38:06 PDT 2014


Revision: 13589
          http://trac.calendarserver.org//changeset/13589
Author:   cdaboo at apple.com
Date:     2014-06-01 17:38:06 -0700 (Sun, 01 Jun 2014)
Log Message:
-----------
Merge willSplit fix from trunk.

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/icalsplitter.py
    CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/test/test_icalsplitter.py

Modified: CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/icalsplitter.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/icalsplitter.py	2014-06-01 18:04:47 UTC (rev 13588)
+++ CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/icalsplitter.py	2014-06-02 00:38:06 UTC (rev 13589)
@@ -63,7 +63,7 @@
         now.offsetDay(1)
         instances = ical.cacheExpandedTimeRanges(now)
         instances = sorted(instances.instances.values(), key=lambda x: x.start)
-        if instances[0].start >= self.past or instances[-1].start < self.now or len(instances) <= 1:
+        if len(instances) <= 1 or instances[0].start >= self.past or instances[-1].start < self.now:
             return False
 
         # Make sure there are some overridden components in the past - as splitting only makes sense when

Modified: CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/test/test_icalsplitter.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/test/test_icalsplitter.py	2014-06-01 18:04:47 UTC (rev 13588)
+++ CalendarServer/branches/release/CalendarServer-5.3-dev/txdav/caldav/datastore/scheduling/test/test_icalsplitter.py	2014-06-02 00:38:06 UTC (rev 13589)
@@ -68,6 +68,10 @@
             getattr(self, attrname_1).offsetSeconds(-1)
             self.subs[attrname_1] = getattr(self, attrname_1)
 
+        setattr(self, "now_future", self.now.duplicate())
+        getattr(self, "now_future").offsetYear(2)
+        self.subs["now_future"] = getattr(self, "now_future")
+
         self.patch(config, "MaxAllowedInstances", 500)
 
 
@@ -191,6 +195,44 @@
                 False,
             ),
             (
+                "#2.3 Small, more than a year in the future, simple recurring component",
+                """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+DTSTART:%(now_future)s
+DURATION:PT1H
+ORGANIZER:mailto:user1 at example.com
+ATTENDEE:mailto:user1 at example.com
+ATTENDEE:mailto:user2 at example.com
+RRULE:FREQ=DAILY
+END:VEVENT
+END:VCALENDAR
+""",
+               False,
+            ),
+            (
+                "#2.4 Small, all cancelled, simple recurring component",
+                """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+DTSTART:%(now_back30)s
+DURATION:PT1H
+ORGANIZER:mailto:user1 at example.com
+ATTENDEE:mailto:user1 at example.com
+ATTENDEE:mailto:user2 at example.com
+EXDATE:%(now_back30)s
+EXDATE:%(now_back29)s
+RRULE:FREQ=DAILY;COUNT=2
+END:VEVENT
+END:VCALENDAR
+""",
+                 False,
+            ),
+            (
                 "#3.1 Small, old, recurring with future override",
                 """BEGIN:VCALENDAR
 VERSION:2.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140601/96a2ac3d/attachment.html>


More information about the calendarserver-changes mailing list