[CalendarServer-changes] [12567] twext/trunk/twext/who/opendirectory/_service.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:21:14 PDT 2014


Revision: 12567
          http://trac.calendarserver.org//changeset/12567
Author:   sagen at apple.com
Date:     2014-02-04 16:32:47 -0800 (Tue, 04 Feb 2014)
Log Message:
-----------
Normalize UUID to uppercase unicode before passing to OD

Modified Paths:
--------------
    twext/trunk/twext/who/opendirectory/_service.py

Modified: twext/trunk/twext/who/opendirectory/_service.py
===================================================================
--- twext/trunk/twext/who/opendirectory/_service.py	2014-02-05 00:10:47 UTC (rev 12566)
+++ twext/trunk/twext/who/opendirectory/_service.py	2014-02-05 00:32:47 UTC (rev 12567)
@@ -21,6 +21,7 @@
 OpenDirectory directory service implementation.
 """
 
+from uuid import UUID
 from zope.interface import implementer
 
 from twisted.internet.defer import succeed, fail
@@ -395,7 +396,12 @@
             queryAttribute = ODAttribute.fromFieldName(
                 expression.fieldName
             ).value
-            queryValue = expression.fieldValue
+            # TODO: support other valuetypes:
+            valueType = self.fieldName.valueType(expression.fieldName)
+            if valueType == UUID:
+                queryValue = unicode(expression.fieldValue).upper()
+            else:
+                queryValue = unicode(expression.fieldValue)
 
         query, error = ODQuery.queryWithNode_forRecordTypes_attribute_matchType_queryValues_returnAttributes_maximumResults_error_(
             self.node,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/a4f721c2/attachment.html>


More information about the calendarserver-changes mailing list