diff options
| author | Antony Lesuisse <al@openerp.com> | 2012-12-27 11:07:53 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2012-12-27 11:07:53 +0100 |
| commit | 61bff67159b74db7d099814f4e44cf04ca0f67ba (patch) | |
| tree | 90a290b7e9f3401614b36bb969327db6641b1992 /addons/web/static/src | |
| parent | abca385d7527cdf68c7afaca864be026abc33c9b (diff) | |
| parent | a49e82615d59dd7de98a5d732894373fbf156d81 (diff) | |
[MERGE] get_session_info cleanup
bzr revid: al@openerp.com-20121227100753-q1jyl37k09ku2px2
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/corelib.js | 20 | ||||
| -rw-r--r-- | addons/web/static/src/js/coresetup.js | 20 |
2 files changed, 13 insertions, 27 deletions
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index f7a84e608c6..5bbd5316521 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -1,16 +1,16 @@ /* * Copyright (c) 2012, OpenERP S.A. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * + * modification, are permitted provided that the following conditions are met: + * * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. + * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * + * and/or other materials provided with the distribution. + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -243,7 +243,7 @@ instance.web.ParentedMixin = { /** * Backbone's events. Do not ever use it directly, use EventDispatcherMixin instead. - * + * * This class just handle the dispatching of events, it is not meant to be extended, * nor used directly. All integration with parenting and automatic unregistration of * events is done in EventDispatcherMixin. @@ -303,7 +303,7 @@ var Events = instance.web.Class.extend({ }); return lst; }, - + trigger : function(events) { var event, node, calls, tail, args, all, rest; if (!(calls = this._callbacks)) @@ -1043,7 +1043,7 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { id: payload.id, sid: this.httpsessionid, }; - + var set_sid = function (response, textStatus, jqXHR) { // If response give us the http session id, we store it for next requests... if (response.httpsessionid) { @@ -1054,7 +1054,7 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { url.url = this.url(url.url, null); var ajax = _.extend({ type: "GET", - dataType: 'jsonp', + dataType: 'jsonp', jsonp: 'jsonp', cache: false, data: data diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index a8b0510389b..43d292b66db 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -49,7 +49,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess _(this.module_list).each(function (mod) { self.module_loaded[mod] = true; }); - this.context = {}; this.active_id = null; return this.session_init(); }, @@ -67,7 +66,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess return deferred.then(function() { return self.load_modules(); }); } return $.when( - deferred, + deferred, self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).then(function(trans) { instance.web._t.database.set_bundle(trans); }) @@ -86,13 +85,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess // If immediately follows a login (triggered by trying to restore // an invalid session or no session at all), refresh session data // (should not change, but just in case...) - _.extend(self, { - session_id: result.session_id, - db: result.db, - username: result.login, - uid: result.uid, - user_context: result.context - }); + _.extend(self, result); }); }, session_is_valid: function() { @@ -109,14 +102,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess if (!result.uid) { return $.Deferred().reject(); } - - _.extend(self, { - session_id: result.session_id, - db: result.db, - username: result.login, - uid: result.uid, - user_context: result.context - }); + _.extend(self, result); if (!_volatile) { self.set_cookie('session_id', self.session_id); } |
