From 266adaa44ca3cca3faba1338fdb0f20f8458b3c3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 18 Feb 2014 13:41:15 +0100 Subject: [PATCH] [FIX] auth_signup: wrap the creation (copy) of the user inside a savepoint to keep the cursor alive in case of postgresql exception bzr revid: chs@openerp.com-20140218124115-39j7vi3l8z6qqh2u --- addons/auth_signup/res_users.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index aaab74271ca..e91af657cc2 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -237,7 +237,8 @@ class res_users(osv.Model): values['active'] = True context = dict(context or {}, no_reset_password=True) try: - return self.copy(cr, uid, template_user_id, values, context=context) + with cr.savepoint(): + return self.copy(cr, uid, template_user_id, values, context=context) except Exception, e: # copy may failed if asked login is not available. raise SignupError(ustr(e))