Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
b102dd52
Commit
b102dd52
authored
Feb 11, 2021
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: do not send recovery email to unreachable addresses
parent
e50e45e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testPasswordTool.py
...plateItem/portal_components/test.erp5.testPasswordTool.py
+26
-0
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.PasswordTool.py
...tTemplateItem/portal_components/tool.erp5.PasswordTool.py
+6
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testPasswordTool.py
View file @
b102dd52
...
...
@@ -434,6 +434,32 @@ class TestPasswordTool(ERP5TypeTestCase):
# But no mail has been sent
self
.
stepCheckNoMailSent
()
def
test_unreachable_email_on_person
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
reference
=
"user"
,
default_email_text
=
"user@example.invalid"
,
)
person
.
getDefaultEmailValue
().
declareUnreachable
()
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'user-login'
,
password
=
'password'
,
)
login
.
validate
()
self
.
tic
()
self
.
logout
()
ret
=
self
.
portal
.
portal_password
.
mailPasswordResetRequest
(
user_login
=
'user-login'
,
REQUEST
=
self
.
portal
.
REQUEST
)
# For security reasons, the message should always be the same
self
.
assertTrue
(
"portal_status_message=An+email+has+been+sent+to+you."
in
str
(
ret
))
# But no mail has been sent
self
.
stepCheckNoMailSent
()
def
test_acquired_email_on_person
(
self
):
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.PasswordTool.py
View file @
b102dd52
...
...
@@ -164,6 +164,12 @@ class PasswordTool(BaseTool):
'ERP5.PasswordTool'
,
INFO
,
"User {user} does not have an email address"
.
format
(
user
=
user_login
)
)
elif
email_value
.
getValidationState
()
!=
"reachable"
:
error_encountered
=
True
LOG
(
'ERP5.PasswordTool'
,
INFO
,
"User {user} does not have a valid email address"
.
format
(
user
=
user_login
)
)
if
error_encountered
:
if
batch
:
raise
RuntimeError
(
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment