[CalendarServer-changes] [14011] CalendarServer/branches/release/CalendarServer-6.0-dev

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 25 10:56:13 PDT 2014


Revision: 14011
          http://trac.calendarserver.org//changeset/14011
Author:   cdaboo at apple.com
Date:     2014-09-25 10:56:13 -0700 (Thu, 25 Sep 2014)
Log Message:
-----------
Fix for attendee being added to the master component after already being invited to an override.

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-6.0-dev/requirements-dev.txt
    CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/itip.py
    CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/test/test_itip.py

Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/requirements-dev.txt
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/requirements-dev.txt	2014-09-25 17:50:46 UTC (rev 14010)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/requirements-dev.txt	2014-09-25 17:56:13 UTC (rev 14011)
@@ -7,4 +7,4 @@
 mockldap
 q
 --editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk@13420#egg=CalDAVClientLibrary
---editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/branches/release/CalDAVTester-6.0@14006-dev#egg=CalDAVTester
+--editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/branches/release/CalDAVTester-6.0@14010-dev#egg=CalDAVTester

Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/itip.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/itip.py	2014-09-25 17:50:46 UTC (rev 14010)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/itip.py	2014-09-25 17:56:13 UTC (rev 14011)
@@ -157,7 +157,7 @@
             # Copy over master alarms, comments etc
             master_component = new_calendar.masterComponent()
             transfer_partstat = None not in needs_action_rids and not reschedule
-            seq_change = Component.compareComponentsForITIP(master_component, current_master, use_dtstamp=False) <= 0
+            seq_change = Component.compareComponentsForITIP(master_component, current_master, use_dtstamp=False) <= 0 if current_master is not None else False
             iTipProcessing._transferItems(master_component, transfer_partstat and seq_change, valarms, private_comments, transps, completeds, organizer_schedule_status, attendee, attendee_dtstamp, other_props, recipient)
 
             # Now try to match recurrences in the new calendar

Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/test/test_itip.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/test/test_itip.py	2014-09-25 17:50:46 UTC (rev 14010)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/txdav/caldav/datastore/scheduling/test/test_itip.py	2014-09-25 17:56:13 UTC (rev 14011)
@@ -34,6 +34,100 @@
     iCalendar support tests
     """
 
+    def test_processRequest(self):
+        """
+        Test iTIPProcessing.processRequest works properly for various scenarios.
+        """
+
+        data = (
+            (
+                "1.1 Attendee added to master after appearing on override only",
+                """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+RECURRENCE-ID:20071114T000000Z
+DTSTART:20071114T010000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+SUMMARY:Test - override
+END:VEVENT
+END:VCALENDAR
+""",
+                """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+METHOD:REQUEST
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071113T000000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+RRULE:FREQ=DAILY
+SUMMARY:Test
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890-1
+RECURRENCE-ID:20071114T000000Z
+DTSTART:20071114T010000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+SUMMARY:Test - override
+END:VEVENT
+END:VCALENDAR
+""",
+                """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071113T000000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+RRULE:FREQ=DAILY
+SUMMARY:Test
+TRANSP:TRANSPARENT
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890-1
+RECURRENCE-ID:20071114T000000Z
+DTSTART:20071114T010000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+SUMMARY:Test - override
+TRANSP:TRANSPARENT
+END:VEVENT
+END:VCALENDAR
+""",
+            ),
+        )
+
+        for title, calendar_txt, itip_txt, changed_txt in data:
+            calendar = Component.fromString(calendar_txt)
+            itip = Component.fromString(itip_txt)
+            changed = Component.fromString(changed_txt)
+
+            result, rids = iTipProcessing.processRequest(itip, calendar, "mailto:user02 at example.com")
+            self.assertEqual(len(rids), 0)
+            self.assertEqual(result, changed, msg="Calendar mismatch: %s" % (title,))
+
+
     def test_processRequest_mergeAttendeePartstat(self):
         """
         Test iTIPProcessing.processRequest properly preserves attendee PARTSTAT when there is no date change
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140925/0194189f/attachment.html>


More information about the calendarserver-changes mailing list