Commit 5aeaf990 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

reference query should be definitely exact match.

otherwise login like 'ASTAIRE AND ROGERS' does not work.
parent cd42e66d
...@@ -27,6 +27,7 @@ from Products.ERP5Type.Cache import CachingMethod ...@@ -27,6 +27,7 @@ from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.ERP5Type \ from Products.ERP5Type.ERP5Type \
import ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT import ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
from Products.PluggableAuthService.PropertiedUser import PropertiedUser from Products.PluggableAuthService.PropertiedUser import PropertiedUser
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
...@@ -120,7 +121,7 @@ class ERP5GroupManager(BasePlugin): ...@@ -120,7 +121,7 @@ class ERP5GroupManager(BasePlugin):
# get the person from its reference - no security check needed # get the person from its reference - no security check needed
catalog_result = self.portal_catalog.unrestrictedSearchResults( 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: # we won't proceed with groups
if len(catalog_result) > 1: # configuration is screwed if len(catalog_result) > 1: # configuration is screwed
raise ConsistencyError, 'There is more than one Person whose \ raise ConsistencyError, 'There is more than one Person whose \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment