From 665bb3cb6225c7a158b11927f8bc639a61400dc9 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 31 Aug 2016 13:00:05 +0200 Subject: [FIX] web: correctly redirect after database creation When a database is created, we are not auto-logged in to the new database anymore because the login passed to the authentication request is 'admin' instead of the one set in the creation form. To fix this issue, we used the login parameter from the creation form in the authentication request. We also set the login field to required in the create database form view. This bug comes from rev https://github.com/odoo/odoo/commit/903733a32 --- addons/web/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/controllers/main.py') diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 98d218d4e54..09f2cd82313 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -653,8 +653,8 @@ class Database(http.Controller): try: # country code could be = "False" which is actually True in python country_code = post.get('country_code') or False - request.session.proxy("db").create_database(master_pwd, name, bool(post.get('demo')), lang, password, post.get('login'), country_code) - request.session.authenticate(name, 'admin', password) + request.session.proxy("db").create_database(master_pwd, name, bool(post.get('demo')), lang, password, post['login'], country_code) + request.session.authenticate(name, post['login'], password) return http.local_redirect('/web/') except Exception, e: error = "Database creation error: %s" % e -- cgit v1.2.3