Commit ec667d3a authored by Vincent Pelletier's avatar Vincent Pelletier

Prevent getUserByLogin from failing due to a degraded catalog (for example if...

Prevent getUserByLogin from failing due to a degraded catalog (for example if it doesn't exist, ERP5Security prevents from accessing the managment screens to fix the situation).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11862 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 284b0deb
......@@ -25,6 +25,7 @@ from Products.PluggableAuthService.utils import classImplements
from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin
from Products.PluggableAuthService.interfaces.plugins import IUserEnumerationPlugin
from Products.ERP5Type.Cache import CachingMethod
from ZODB.POSException import ConflictError
from zLOG import LOG
......@@ -174,8 +175,13 @@ class ERP5UserManager(BasePlugin):
newSecurityManager(self, self.getUser(SUPER_USER))
try:
result = self.getPortalObject().portal_catalog(
portal_type="Person", reference=login)
try:
result = self.getPortalObject().portal_catalog(
portal_type="Person", reference=login)
except ConflictError:
raise
except:
LOG('ERP5Security', 0, 'getUserByLogin failed', error=sys.exc_info())
finally:
setSecurityManager(sm)
return [item.getObject() for item in result]
......
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