Show More
@@ -326,7 +326,17 b' class LoginView(object):' | |||
|
326 | 326 | error_dict = {'recaptcha_field': _msg} |
|
327 | 327 | raise formencode.Invalid(_msg, _value, None, |
|
328 | 328 | error_dict=error_dict) |
|
329 | UserModel().reset_password_link(form_result) | |
|
329 | ||
|
330 | # Generate reset URL and send mail. | |
|
331 | user_email = form_result['email'] | |
|
332 | user = User.get_by_email(user_email) | |
|
333 | password_reset_url = self.request.route_url( | |
|
334 | 'reset_password_confirmation', | |
|
335 | _query={'key': user.api_key}) | |
|
336 | UserModel().reset_password_link( | |
|
337 | form_result, password_reset_url) | |
|
338 | ||
|
339 | # Display success message and redirect. | |
|
330 | 340 | self.session.flash( |
|
331 | 341 | _('Your password reset link was sent'), |
|
332 | 342 | queue='success') |
@@ -493,7 +493,7 b' class UserModel(BaseModel):' | |||
|
493 | 493 | log.error(traceback.format_exc()) |
|
494 | 494 | raise |
|
495 | 495 | |
|
496 | def reset_password_link(self, data): | |
|
496 | def reset_password_link(self, data, pwd_reset_url): | |
|
497 | 497 | from rhodecode.lib.celerylib import tasks, run_task |
|
498 | 498 | from rhodecode.model.notification import EmailNotificationModel |
|
499 | 499 | user_email = data['email'] |
@@ -502,12 +502,8 b' class UserModel(BaseModel):' | |||
|
502 | 502 | if user: |
|
503 | 503 | log.debug('password reset user found %s', user) |
|
504 | 504 | |
|
505 | password_reset_url = url( | |
|
506 | 'reset_password_confirmation', key=user.api_key, | |
|
507 | qualified=True) | |
|
508 | ||
|
509 | 505 | email_kwargs = { |
|
510 |
'password_reset_url': p |
|
|
506 | 'password_reset_url': pwd_reset_url, | |
|
511 | 507 | 'user': user, |
|
512 | 508 | 'email': user_email, |
|
513 | 509 | 'date': datetime.datetime.now() |
General Comments 0
You need to be logged in to leave comments.
Login now