[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
This commit is contained in:
Christophe Simonis 2014-02-18 13:41:15 +01:00
parent 35439fc864
commit 266adaa44c
1 changed files with 2 additions and 1 deletions

View File

@ -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))