# HG changeset patch # User Marcin Kuzminski # Date 2016-08-01 21:11:16 # Node ID 91bf0444fc75b49d4b68f872b6a6c3cbdb999811 # Parent cb20225a1a66cedf4769a1bd9278087a1be65c82 emails: fixed password reset confirmation that was broken because of undefied variable. diff --git a/rhodecode/login/views.py b/rhodecode/login/views.py --- a/rhodecode/login/views.py +++ b/rhodecode/login/views.py @@ -327,8 +327,11 @@ class LoginView(object): if self.request.GET and self.request.GET.get('key'): try: user = User.get_by_auth_token(self.request.GET.get('key')) + password_reset_url = self.request.route_url( + 'reset_password_confirmation', + _query={'key': user.api_key}) data = {'email': user.email} - UserModel().reset_password(data) + UserModel().reset_password(data, password_reset_url) self.session.flash( _('Your password reset was successful, ' 'a new password has been sent to your email'), diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -532,7 +532,7 @@ class UserModel(BaseModel): return True - def reset_password(self, data): + def reset_password(self, data, pwd_reset_url): from rhodecode.lib.celerylib import tasks, run_task from rhodecode.model.notification import EmailNotificationModel from rhodecode.lib import auth @@ -557,6 +557,7 @@ class UserModel(BaseModel): email_kwargs = { 'new_password': new_passwd, + 'password_reset_url': pwd_reset_url, 'user': user, 'email': user_email, 'date': datetime.datetime.now()