Commit 8c025549 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_core: Only search for ERP5 Login

   The implementation only works with ERP5 Login, since it is the only portal type that
   holds password in ERP5. Other implementations are password-less: Certificate Login,
   Google Login and Facebook Login, so they cannot have their password reset anyway.

   It is overkill split the login on multiple categorization, to use some portal group (ie:
   getPortalLoginPortalTypeThatCanResetPassord...) until we have a a clear usecase.
parent 038ac81c
...@@ -142,6 +142,7 @@ class PasswordTool(BaseTool): ...@@ -142,6 +142,7 @@ class PasswordTool(BaseTool):
# check user exists, and have an email # check user exists, and have an email
user_path_set = {x['path'] for x in self.getPortalObject().acl_users.searchUsers( user_path_set = {x['path'] for x in self.getPortalObject().acl_users.searchUsers(
login=user_login, login=user_login,
login_portal_type='ERP5 Login',
exact_match=True, exact_match=True,
) if 'path' in x} ) if 'path' in x}
if len(user_path_set) == 0: if len(user_path_set) == 0:
...@@ -253,6 +254,7 @@ class PasswordTool(BaseTool): ...@@ -253,6 +254,7 @@ class PasswordTool(BaseTool):
return [] return []
user_dict_list = portal.acl_users.searchUsers( user_dict_list = portal.acl_users.searchUsers(
login=register_user_login, login=register_user_login,
login_portal_type='ERP5 Login',
exact_match=True, exact_match=True,
) )
if user_dict_list: if user_dict_list:
...@@ -300,6 +302,7 @@ class PasswordTool(BaseTool): ...@@ -300,6 +302,7 @@ class PasswordTool(BaseTool):
portal = self.getPortalObject() portal = self.getPortalObject()
user_dict, = portal.acl_users.searchUsers( user_dict, = portal.acl_users.searchUsers(
login=register_user_login, login=register_user_login,
login_portal_type='ERP5 Login',
exact_match=True, exact_match=True,
) )
login_dict, = user_dict['login_list'] login_dict, = user_dict['login_list']
......
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