[CalendarServer-changes] [13104] CalendarServer/trunk/txdav/caldav/datastore/scheduling

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 1 14:26:29 PDT 2014


Revision: 13104
          http://trac.calendarserver.org//changeset/13104
Author:   cdaboo at apple.com
Date:     2014-04-01 14:26:28 -0700 (Tue, 01 Apr 2014)
Log Message:
-----------
Avoid exception when organizer exists in directory but not in the store.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_utils.py
    CalendarServer/trunk/txdav/caldav/datastore/scheduling/utils.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_utils.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_utils.py	2014-04-01 21:17:46 UTC (rev 13103)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_utils.py	2014-04-01 21:26:28 UTC (rev 13104)
@@ -182,7 +182,14 @@
         self.assertTrue((resource2 is not None) ^ (resource3 is not None))
         yield self.commit()
 
+        # Look up resource where principal exists but home does not
+        principal = buildDirectoryRecord("user102")
+        txn = self.transactionUnderTest()
+        resource = (yield getCalendarObjectForRecord(txn, principal, "685BC3A1-195A-49B3-926D-388DDACA78A6"))
+        self.assertTrue(resource is None)
+        yield self.commit()
 
+
     def test_extractEmailDomain(self):
         """
         Test that L{extractEmailDomain} returns the expected results.

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/utils.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/utils.py	2014-04-01 21:17:46 UTC (rev 13103)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/utils.py	2014-04-01 21:26:28 UTC (rev 13104)
@@ -32,6 +32,8 @@
     if record and record.thisServer():
         # Get record's calendar-home
         calendar_home = yield txn.calendarHomeWithUID(record.uid)
+        if calendar_home is None:
+            returnValue(None)
 
         # Get matching newstore objects
         objectResources = (yield calendar_home.getCalendarResourcesForUID(uid))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140401/a8640161/attachment.html>


More information about the calendarserver-changes mailing list