[CalendarServer-changes] [14162] twext/trunk/twext/who/aggregate.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 12 16:15:42 PST 2014


Revision: 14162
          http://trac.calendarserver.org//changeset/14162
Author:   wsanchez at apple.com
Date:     2014-11-12 16:15:42 -0800 (Wed, 12 Nov 2014)
Log Message:
-----------
Make it hard to cheat.

Modified Paths:
--------------
    twext/trunk/twext/who/aggregate.py

Modified: twext/trunk/twext/who/aggregate.py
===================================================================
--- twext/trunk/twext/who/aggregate.py	2014-11-13 00:14:47 UTC (rev 14161)
+++ twext/trunk/twext/who/aggregate.py	2014-11-13 00:15:42 UTC (rev 14162)
@@ -26,6 +26,7 @@
 import collections
 from itertools import chain
 
+from twisted.python.components import proxyForInterface
 from twisted.internet.defer import (
     gatherResults, FirstError, succeed, inlineCallbacks, returnValue
 )
@@ -51,6 +52,10 @@
                     "Not a directory service: {0}".format(service)
                 )
 
+            service = proxyForInterface(IDirectoryService)(
+                service, originalAttribute="_service"
+            )
+
             for recordType in service.recordTypes():
                 if recordType in recordTypes:
                     raise DirectoryConfigurationError(
@@ -184,8 +189,8 @@
 
     @inlineCallbacks
     def updateRecords(self, records, create=False):
-
-        # When migrating there may be lots of new records so batch this by each service record type
+        # When migrating there may be lots of new records so batch this by each
+        # service record type.
         recordsByType = collections.defaultdict(list)
         for record in records:
             recordsByType[record.recordType].append(record)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20141112/d10e7989/attachment.html>


More information about the calendarserver-changes mailing list