Show More
@@ -327,8 +327,11 b' class LoginView(object):' | |||||
327 | if self.request.GET and self.request.GET.get('key'): |
|
327 | if self.request.GET and self.request.GET.get('key'): | |
328 | try: |
|
328 | try: | |
329 | user = User.get_by_auth_token(self.request.GET.get('key')) |
|
329 | user = User.get_by_auth_token(self.request.GET.get('key')) | |
|
330 | password_reset_url = self.request.route_url( | |||
|
331 | 'reset_password_confirmation', | |||
|
332 | _query={'key': user.api_key}) | |||
330 | data = {'email': user.email} |
|
333 | data = {'email': user.email} | |
331 | UserModel().reset_password(data) |
|
334 | UserModel().reset_password(data, password_reset_url) | |
332 | self.session.flash( |
|
335 | self.session.flash( | |
333 | _('Your password reset was successful, ' |
|
336 | _('Your password reset was successful, ' | |
334 | 'a new password has been sent to your email'), |
|
337 | 'a new password has been sent to your email'), |
@@ -532,7 +532,7 b' class UserModel(BaseModel):' | |||||
532 |
|
532 | |||
533 | return True |
|
533 | return True | |
534 |
|
534 | |||
535 | def reset_password(self, data): |
|
535 | def reset_password(self, data, pwd_reset_url): | |
536 | from rhodecode.lib.celerylib import tasks, run_task |
|
536 | from rhodecode.lib.celerylib import tasks, run_task | |
537 | from rhodecode.model.notification import EmailNotificationModel |
|
537 | from rhodecode.model.notification import EmailNotificationModel | |
538 | from rhodecode.lib import auth |
|
538 | from rhodecode.lib import auth | |
@@ -557,6 +557,7 b' class UserModel(BaseModel):' | |||||
557 |
|
557 | |||
558 | email_kwargs = { |
|
558 | email_kwargs = { | |
559 | 'new_password': new_passwd, |
|
559 | 'new_password': new_passwd, | |
|
560 | 'password_reset_url': pwd_reset_url, | |||
560 | 'user': user, |
|
561 | 'user': user, | |
561 | 'email': user_email, |
|
562 | 'email': user_email, | |
562 | 'date': datetime.datetime.now() |
|
563 | 'date': datetime.datetime.now() |
General Comments 0
You need to be logged in to leave comments.
Login now