[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:
parent
35439fc864
commit
266adaa44c
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue