Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
fa3cec01
Commit
fa3cec01
authored
Mar 12, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: catch error
parent
e36dc06c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.PasswordTool.py
...tTemplateItem/portal_components/tool.erp5.PasswordTool.py
+15
-6
No files found.
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.PasswordTool.py
View file @
fa3cec01
...
@@ -215,15 +215,24 @@ class PasswordTool(BaseTool):
...
@@ -215,15 +215,24 @@ class PasswordTool(BaseTool):
'resource'
:
notification_message
.
getSpecialise
(),
'resource'
:
notification_message
.
getSpecialise
(),
'language'
:
notification_message
.
getLanguage
(),
'language'
:
notification_message
.
getLanguage
(),
}
}
success
=
True
try
:
self
.
getPortalObject
().
portal_notifications
.
sendMessage
(
sender
=
sender
,
recipient
=
[
user_value
,],
subject
=
subject
,
message
=
message
,
store_as_event
=
store_as_event
,
message_text_format
=
message_text_format
,
event_keyword_argument_dict
=
event_keyword_argument_dict
)
except
:
#XXXX what's the error type
success
=
False
self
.
getPortalObject
().
portal_notifications
.
sendMessage
(
sender
=
sender
,
recipient
=
[
user_value
,],
subject
=
subject
,
message
=
message
,
store_as_event
=
store_as_event
,
message_text_format
=
message_text_format
,
event_keyword_argument_dict
=
event_keyword_argument_dict
)
if
not
batch
:
if
not
batch
:
if
success
:
msg
=
"An email has been sent to you."
else
:
msg
=
"An error occured when send a reset password mail, please try later again"
return
redirect
(
REQUEST
,
site_url
,
return
redirect
(
REQUEST
,
site_url
,
translateString
(
"An email has been sent to you."
))
translateString
(
msg
))
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'removeExpiredRequests'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'removeExpiredRequests'
)
def
removeExpiredRequests
(
self
):
def
removeExpiredRequests
(
self
):
...
...
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