[FIX] auth_oauth: Override qcontext in the right place

Before this patch, if some module was based on top of `auth_signup`, and `auth_oauth` was also installed in the same database, the only way to get the proper qcontext would be to call `super()` inside `web_auth_signup_qcontext`, which would produce a login, which is most likely not desired because such addon would try to add some logic on top of it that maybe prevents login based on some circumstances.

After this patch, any submodules can work properly without workarounds.

closes odoo/odoo#34690

Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
Jairo Llopis
2019-07-09 11:31:25 +00:00
parent 3862f63669
commit 7c99310b23
+4 -13
View File
@@ -109,19 +109,10 @@ class OAuthLogin(Home):
return response
@http.route()
def web_auth_signup(self, *args, **kw):
providers = self.list_providers()
response = super(OAuthLogin, self).web_auth_signup(*args, **kw)
response.qcontext.update(providers=providers)
return response
@http.route()
def web_auth_reset_password(self, *args, **kw):
providers = self.list_providers()
response = super(OAuthLogin, self).web_auth_reset_password(*args, **kw)
response.qcontext.update(providers=providers)
return response
def get_auth_signup_qcontext(self):
result = super(OAuthLogin, self).get_auth_signup_qcontext()
result["providers"] = self.list_providers()
return result
class OAuthController(http.Controller):