diff options
| author | Christophe Simonis <chs@openerp.com> | 2012-10-15 18:23:46 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2012-10-15 18:23:46 +0200 |
| commit | 3adab7ba8c71cd222e9f9b56cb50b8d7fdfe3ff8 (patch) | |
| tree | a993417dd60abbc4afc6d102bfdee556080a38c2 /addons/web/static/src/js/coresetup.js | |
| parent | bc1a3dff21bf7bdb4c67aa1ad5e3bca237d4945c (diff) | |
[IMP]: once bound, a session cannot be bound to another server
bzr revid: chs@openerp.com-20121015162346-jwhctk988fftjsa4
Diffstat (limited to 'addons/web/static/src/js/coresetup.js')
| -rw-r--r-- | addons/web/static/src/js/coresetup.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 1f1112df2f2..cf533ed0b59 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -27,6 +27,12 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess * Setup a sessionm */ session_bind: function(origin) { + if (!_.isUndefined(this.origin)) { + if (this.origin === origin) { + return $.when(); + } + throw new Error('Session already bound to ' + this.origin); + } var self = this; this.setup(origin); instance.web.qweb.default_dict['_s'] = this.origin; |
