From 592e6d34cc2001a626397666e7a35c5cfd775c6e Mon Sep 17 00:00:00 2001 From: Ricky Ramirez Date: Tue, 18 Jun 2013 23:28:53 -0700 Subject: [PATCH] api: Send notifications of password changes. --- r2/r2/controllers/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index c8782fe4d..a55983590 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -957,6 +957,8 @@ class ApiController(RedditController, OAuth2ResourceController): not (form.has_errors("newpass", errors.BAD_PASSWORD) or form.has_errors("verpass", errors.BAD_PASSWORD_MATCH))): change_password(c.user, password) + if c.user.email_verified: + emailer.password_change_email(c.user) if updated: form.set_html(".status", _('your email and password have been updated')) @@ -2454,6 +2456,8 @@ class ApiController(RedditController, OAuth2ResourceController): # successfully entered user name and valid new password change_password(user, password) + if user.email_verified: + emailer.password_change_email(user) g.log.warning("%s did a password reset for %s via %s", request.ip, user.name, token._id)