Commit 3d929b7d 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 082f0ac2
...@@ -283,10 +283,10 @@ class PasswordTool(BaseTool): ...@@ -283,10 +283,10 @@ class PasswordTool(BaseTool):
return error("Date has expire.") return error("Date has expire.")
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.checkPasswordValueAcceptable(password) # this will raise if password does not match policy login.checkPasswordValueAcceptable(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