summaryrefslogtreecommitdiff
path: root/addons/auth_signup
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2017-02-15 22:55:46 +0100
committerOlivier Dony <odo@openerp.com>2017-05-05 17:02:46 +0200
commit6921da00b3a253ea5d0cdd135a8629ef9cb14ca7 (patch)
tree5a7af60019f90e090eb5aab929df54febc2def18 /addons/auth_signup
parent21482ac263d965dfe29deaed365c1d297f170e2e (diff)
[FIX] auth_signup: properly log password reset requests
Diffstat (limited to 'addons/auth_signup')
-rw-r--r--addons/auth_signup/controllers/main.py3
-rw-r--r--addons/auth_signup/models/res_users.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py
index 2718e47dd2a..5b45e068289 100644
--- a/addons/auth_signup/controllers/main.py
+++ b/addons/auth_signup/controllers/main.py
@@ -57,6 +57,9 @@ class AuthSignupHome(Home):
else:
login = qcontext.get('login')
assert login, "No login provided."
+ _logger.info(
+ "Password reset attempt for <%s> by user <%s> from %s",
+ login, request.env.user.login, request.httprequest.remote_addr)
request.env['res.users'].sudo().reset_password(login)
qcontext['message'] = _("An email has been sent with credentials to reset your password")
except SignupError:
diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py
index c82a35792a2..f348df3c49b 100644
--- a/addons/auth_signup/models/res_users.py
+++ b/addons/auth_signup/models/res_users.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import logging
from ast import literal_eval
@@ -11,6 +12,7 @@ from odoo.tools.misc import ustr
from odoo.addons.base.ir.ir_mail_server import MailDeliveryException
from odoo.addons.auth_signup.models.res_partner import SignupError, now
+_logger = logging.getLogger(__name__)
class ResUsers(models.Model):
_inherit = 'res.users'
@@ -134,6 +136,7 @@ class ResUsers(models.Model):
if not user.email:
raise UserError(_("Cannot send email: user %s has no email address.") % user.name)
template.with_context(lang=user.lang).send_mail(user.id, force_send=True, raise_exception=True)
+ _logger.info("Password reset email sent for user <%s> to <%s>", user.login, user.email)
@api.model
def create(self, values):