[CalendarServer-changes] [13281] twext/trunk/twext/who/opendirectory/_service.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Apr 15 13:42:44 PDT 2014
Revision: 13281
http://trac.calendarserver.org//changeset/13281
Author: wsanchez at apple.com
Date: 2014-04-15 13:42:44 -0700 (Tue, 15 Apr 2014)
Log Message:
-----------
Don't deference cosntants early.
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-04-15 18:34:29 UTC (rev 13280)
+++ twext/trunk/twext/who/opendirectory/_service.py 2014-04-15 20:42:44 UTC (rev 13281)
@@ -235,10 +235,12 @@
notOp = u""
# if MatchFlags.caseInsensitive not in flags:
- # raise NotImplementedError("Need to handle case sensitive")
+ # raise QueryNotSupportedError(
+ # "Case sensitive searches are not supported by LDAP"
+ # )
if expression.fieldName is self.fieldName.recordType:
- return (notOp, ODRecordType.fromRecordType(expression.fieldValue).value)
+ return (notOp, ODRecordType.fromRecordType(expression.fieldValue))
if expression.fieldName is self.fieldName.uid:
odAttr = ODAttribute.guid
@@ -317,7 +319,7 @@
return (u"".join(queryTokens), recordTypes)
- def _queryStringAndRecordTypesFromExpression(self, expression, recordTypes=set([t.value for t in ODRecordType.iterconstants()])):
+ def _queryStringAndRecordTypesFromExpression(self, expression, recordTypes=set(ODRecordType.iterconstants())):
"""
Converts either a MatchExpression or a CompoundExpression into an LDAP
query string.
@@ -370,7 +372,7 @@
query, error = ODQuery.queryWithNode_forRecordTypes_attribute_matchType_queryValues_returnAttributes_maximumResults_error_(
self.node,
- recordTypes,
+ (t.value for t in recordTypes),
None,
ODMatchType.compound.value if queryString else ODMatchType.any.value,
queryString,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140415/3808045f/attachment.html>
More information about the calendarserver-changes
mailing list