emails: fixed password reset confirmation that was broken because of undefied variable.

This commit is contained in:
Marcin Kuzminski 2016-08-01 23:11:16 +02:00
parent 658ecbf1d0
commit 9d875ad256
2 changed files with 6 additions and 2 deletions

View file

@ -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'),

View file

@ -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()