Commit fa3cec01 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_core: catch error

parent e36dc06c
......@@ -215,15 +215,24 @@ class PasswordTool(BaseTool):
'resource':notification_message.getSpecialise(),
'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 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,
translateString("An email has been sent to you."))
translateString(msg))
security.declareProtected(Permissions.ModifyPortalContent, 'removeExpiredRequests')
def removeExpiredRequests(self):
......
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