From 77d3f168ca610dbbe710d33337ee18f03e45f630 Mon Sep 17 00:00:00 2001 From: Vishmita Date: Thu, 6 Dec 2012 17:52:19 +0530 Subject: [PATCH] [FIX]Minor change bzr revid: vja@tinyerp.com-20121206122219-tcod9bad69fgr836 --- addons/auth_signup/res_users.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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