From 5aeaf99047a7cb9251d9679ed64ebeab11480321 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Mon, 2 Dec 2013 15:19:25 +0100
Subject: [PATCH] reference query should be definitely exact match.

otherwise login like 'ASTAIRE AND ROGERS' does not work.
---
 product/ERP5Security/ERP5GroupManager.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Security/ERP5GroupManager.py b/product/ERP5Security/ERP5GroupManager.py
index 2ff0d76fe5..b4402db3ff 100644
--- a/product/ERP5Security/ERP5GroupManager.py
+++ b/product/ERP5Security/ERP5GroupManager.py
@@ -27,6 +27,7 @@ from Products.ERP5Type.Cache import CachingMethod
 from Products.ERP5Type.ERP5Type \
   import ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT
 from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
+from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
 from Products.PluggableAuthService.PropertiedUser import PropertiedUser
 from ZODB.POSException import ConflictError
 
@@ -120,7 +121,7 @@ class ERP5GroupManager(BasePlugin):
 
         # get the person from its reference - no security check needed
         catalog_result = self.portal_catalog.unrestrictedSearchResults(
-            portal_type="Person", reference=user_name)
+            portal_type="Person", query=SimpleQuery(reference=user_name))
         if len(catalog_result) != 1: # we won't proceed with groups
           if len(catalog_result) > 1: # configuration is screwed
             raise ConsistencyError, 'There is more than one Person whose \
-- 
2.30.9