From a7b83cd503b000a7ec61ccf162443eed9fff83a2 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Thu, 26 Jul 2007 15:49:40 +0000 Subject: [PATCH] Woops again, I'm caching brains. Cache paths instead. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15329 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Security/ERP5UserManager.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/product/ERP5Security/ERP5UserManager.py b/product/ERP5Security/ERP5UserManager.py index 28ff4ccb04..f51842965d 100644 --- a/product/ERP5Security/ERP5UserManager.py +++ b/product/ERP5Security/ERP5UserManager.py @@ -173,6 +173,8 @@ class ERP5UserManager(BasePlugin): if not login: return [] + portal = self.getPortalObject() + def _getUserByLogin(login): # because we aren't logged in, we have to create our own # SecurityManager to be able to access the Catalog @@ -182,7 +184,7 @@ class ERP5UserManager(BasePlugin): try: try: - result = self.getPortalObject().portal_catalog.unrestrictedSearchResults( + result = portal.portal_catalog.unrestrictedSearchResults( portal_type="Person", reference=login) except ConflictError: raise @@ -197,12 +199,12 @@ class ERP5UserManager(BasePlugin): raise _SWALLOWABLE_PLUGIN_EXCEPTIONS[0] finally: setSecurityManager(sm) - return result + return [x.path for x in result] _getUserByLogin = CachingMethod(_getUserByLogin, id='ERP5UserManager_getUserByLogin', cache_factory='erp5_content_short') result = _getUserByLogin(login) - return [item.getObject() for item in result] + return [portal.unrestrictedTraverse(x) for x in result] classImplements( ERP5UserManager , IAuthenticationPlugin -- 2.30.9