From 3f34405c7ca001cfba610ae15e9120c0edbebeb1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 13 Jan 2014 18:36:43 +0100 Subject: [PATCH] [IMP] login user at db creation bzr revid: fme@openerp.com-20140113173643-ire4cnb2nbxhs8dh --- addons/web/controllers/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7fd9dcd89a2..4393823314c 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -809,6 +809,7 @@ class Database(http.Controller): @http.route('/web/database/manager', type='http', auth="none") def manager(self, debug=False): + request.session.logout() debug = debug is not False # we just check presence of `debug` query param js = "\n ".join('' % i for i in manifest_list('js', debug=debug)) css = "\n ".join('' % i for i in manifest_list('css', debug=debug)) @@ -838,12 +839,15 @@ class Database(http.Controller): @http.route('/web/database/create', type='json', auth="none") def create(self, fields): params = dict(map(operator.itemgetter('name', 'value'), fields)) - return request.session.proxy("db").create_database( + db_created = request.session.proxy("db").create_database( params['super_admin_pwd'], params['db_name'], bool(params.get('demo_data')), params['db_lang'], params['create_admin_pwd']) + if db_created: + request.session.authenticate(params['db_name'], 'admin', params['create_admin_pwd']) + return db_created @http.route('/web/database/duplicate', type='json', auth="none") def duplicate(self, fields):