Commit 716493d6 authored by Rafael Monnerat's avatar Rafael Monnerat

PasswordTool: Ignore entries which don't come from ERP5LoginUserManager

  The user can be present from diferent logins, password tool only works with ERP5LoginUserMager
  users.
parent 525d2d6c
...@@ -295,10 +295,10 @@ class PasswordTool(BaseTool): ...@@ -295,10 +295,10 @@ class PasswordTool(BaseTool):
return error("Date has expired.") return error("Date has expired.")
del self._password_request_dict[password_key] del self._password_request_dict[password_key]
portal = self.getPortalObject() portal = self.getPortalObject()
user_dict, = portal.acl_users.searchUsers( user_dict, = [x for x in portal.acl_users.searchUsers(
login=register_user_login, login=register_user_login,
exact_match=True, exact_match=True,) if 'login_list' in x]
)
login_dict, = user_dict['login_list'] login_dict, = user_dict['login_list']
login = portal.unrestrictedTraverse(login_dict['path']) login = portal.unrestrictedTraverse(login_dict['path'])
login.setPassword(password) # this will raise if password does not match policy login.setPassword(password) # this will raise if password does not match policy
......
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