diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index 5fd7917f444..8a4d3f657d5 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -246,7 +246,16 @@ class res_users(osv.Model): for user in self.browse(cr, uid, ids, context): if not user.email: raise osv.except_osv(_("Cannot send email: user has no email address."), user.name) - self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context) + msg_id = None + msg_id = self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context) + if not msg_id: + raise osv.except_osv(_("The email to reset the password has not been sent. Configure the outgoing server and retry resetting the password"), "") + else : + warning = { + 'title': _("Reset Password"), + 'message': _("An email has been sent to %s, the user will be able to change his password using the link provided in the email. The old password is still valid until the user changes his password.")% user.email + } + return {'warning':warning} return True