From df6668cd7896956e11fc03dc035e2591cb5ecd41 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 3 Sep 2012 13:30:59 +0200 Subject: [PATCH] [REM] Session remove on_session bzr revid: al@openerp.com-20120903113059-8jts6776xryjeadl --- addons/web/static/src/js/corelib.js | 6 ------ addons/web/static/src/js/coresetup.js | 20 +------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 8a28c0a8a4d..c74c2d5dc03 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -1323,12 +1323,6 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({ deferred.resolve(response["result"], textStatus, jqXHR); } else if (response.error.data.type === "session_invalid") { self.uid = false; - // TODO deprecate or use a deferred on login.do_ask_login() - self.on_session_invalid(function() { - self.rpc(url, payload.params, - function() { deferred.resolve.apply(deferred, arguments); }, - function() { deferred.reject.apply(deferred, arguments); }); - }); } else { deferred.reject(response.error, $.Event()); } diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 38cf57387d1..0c10d40f0ca 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -113,20 +113,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess this.set_cookie('session_id', ''); return this.rpc("/web/session/destroy", {}); }, - on_session_valid: function() { - }, - /** - * Called when a rpc call fail due to an invalid session. - * By default, it's a noop - */ - on_session_invalid: function(retry_callback) { - }, - /** - * Fetches a cookie stored by an openerp session - * - * @private - * @param name the cookie's name - */ get_cookie: function (name) { if (!this.name) { return null; } var nameEQ = this.name + '|' + name + '='; @@ -160,9 +146,8 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess /** * Load additional web addons of that instance and init them * - * @param {Boolean} [no_session_valid_signal=false] prevents load_module from triggering ``on_session_valid``. */ - load_modules: function(no_session_valid_signal) { + load_modules: function() { var self = this; return this.rpc('/web/session/modules', {}).pipe(function(result) { var lang = self.user_context.lang, @@ -195,9 +180,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess return loaded.then(function() { self.on_modules_loaded(); self.trigger('module_loaded'); - if (!no_session_valid_signal) { - self.on_session_valid(); - } }); }); },