Commit 6e304079 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_credential: raise an exception if login not found in mailPasswordResetRequest().

parent e1598166
...@@ -25,4 +25,5 @@ portal.portal_password.mailPasswordResetRequest(user_login=reference, ...@@ -25,4 +25,5 @@ portal.portal_password.mailPasswordResetRequest(user_login=reference,
REQUEST=context.REQUEST, REQUEST=context.REQUEST,
notification_message=notification_message, notification_message=notification_message,
store_as_event=portal.portal_preferences.isPreferredStoreEvents(), store_as_event=portal.portal_preferences.isPreferredStoreEvents(),
batch=True,
**kw) **kw)
...@@ -114,7 +114,8 @@ class PasswordTool(BaseTool): ...@@ -114,7 +114,8 @@ class PasswordTool(BaseTool):
notification_message=None, sender=None, notification_message=None, sender=None,
store_as_event=False, store_as_event=False,
expiration_date=None, expiration_date=None,
substitution_method_parameter_dict=None): substitution_method_parameter_dict=None,
batch=False):
""" """
Create a random string and expiration date for request Create a random string and expiration date for request
Parameters: Parameters:
...@@ -162,7 +163,10 @@ class PasswordTool(BaseTool): ...@@ -162,7 +163,10 @@ class PasswordTool(BaseTool):
"User ${user} does not have an email address, please contact site " "User ${user} does not have an email address, please contact site "
"administrator directly", mapping={'user':user_login}) "administrator directly", mapping={'user':user_login})
if msg: if msg:
return redirect(REQUEST, site_url, msg) if batch:
raise RuntimeError(msg)
else:
return redirect(REQUEST, site_url, msg)
key = self.getResetPasswordKey(user_login=user_login, key = self.getResetPasswordKey(user_login=user_login,
expiration_date=expiration_date) expiration_date=expiration_date)
...@@ -209,8 +213,9 @@ class PasswordTool(BaseTool): ...@@ -209,8 +213,9 @@ class PasswordTool(BaseTool):
store_as_event=store_as_event, store_as_event=store_as_event,
message_text_format=message_text_format, message_text_format=message_text_format,
event_keyword_argument_dict=event_keyword_argument_dict) event_keyword_argument_dict=event_keyword_argument_dict)
return redirect(REQUEST, site_url, if not batch:
translateString("An email has been sent to you.")) return redirect(REQUEST, site_url,
translateString("An email has been sent to you."))
def _generateUUID(self, args=""): def _generateUUID(self, args=""):
""" """
......
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