[FIX] auth_signup: correct authentification after successfull signup
authorChristophe Simonis <chs@openerp.com>
Thu, 13 Feb 2014 19:08:45 +0000 (20:08 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 13 Feb 2014 19:08:45 +0000 (20:08 +0100)
bzr revid: chs@openerp.com-20140213190845-azch00bppzp1pk0d

addons/auth_signup/controllers/main.py

index ba04453..16baa97 100644 (file)
@@ -96,8 +96,9 @@ class AuthSignup(openerp.addons.web.controllers.main.Home):
 
     def _signup_with_values(self, token, values):
         db, login, password = request.registry['res.users'].signup(request.cr, openerp.SUPERUSER_ID, values, token)
+        request.cr.commit()     # as authenticate will use its own cursor we need to commit the current transaction
         uid = request.session.authenticate(db, login, password)
-        if uid is not False:
+        if not uid:
             raise SignupError(_('Authentification Failed.'))