From 6c25b2df25af60ddaebf3d6eae831b7eef7e7f09 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 9 Aug 2013 16:55:06 +0200 Subject: [FIX]auth_oauth: auth_oauth handle oauth error 3, auth_oauth_signup raise accessdenied instead of signuperror, auth_signup use literal_eval instead of safe_eval bzr revid: dle@openerp.com-20130809145506-agzyvk8m1pr858jf --- addons/auth_oauth/static/src/js/auth_oauth.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'addons/auth_oauth/static/src/js') diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js index 131ae5c1c42..5046469a5dc 100644 --- a/addons/auth_oauth/static/src/js/auth_oauth.js +++ b/addons/auth_oauth/static/src/js/auth_oauth.js @@ -1,4 +1,6 @@ openerp.auth_oauth = function(instance) { + var _t = instance.web._t, + _lt = instance.web._lt; var QWeb = instance.web.qweb; instance.web.Login.include({ @@ -9,9 +11,11 @@ openerp.auth_oauth = function(instance) { this.$el.on('click', 'a.zocial', this.on_oauth_sign_in); this.oauth_providers = []; if(this.params.oauth_error === 1) { - this.do_warn("Sign up error.","Sign up is not allowed on this database."); + this.do_warn(_t("Sign up error"),_t("Sign up is not allowed on this database."), true); } else if(this.params.oauth_error === 2) { - this.do_warn("Authentication error",""); + this.do_warn(_t("Authentication error"),_t("Access Denied"), true); + } else if(this.params.oauth_error === 3) { + this.do_warn(_t("Authentication error"),_t("You do not have access to this database or your invitation has expired. Please ask for an invitation and be sure to follow the link in your invitation email."), true); } return d.done(this.do_oauth_load).fail(function() { self.do_oauth_load([]); -- cgit v1.2.3