From 7b5e85f80f888151f572f21eb1f46ba8304b885b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 29 Jul 2016 16:22:49 +0200 Subject: [PATCH] [website_seo_redirection][FIX] Avoid some weird 403 errors. This hopefully fixes #222. --- website_seo_redirection/models/ir_http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website_seo_redirection/models/ir_http.py b/website_seo_redirection/models/ir_http.py index 13fc2ac0c3..1ec4b8ff6c 100644 --- a/website_seo_redirection/models/ir_http.py +++ b/website_seo_redirection/models/ir_http.py @@ -16,6 +16,10 @@ def _dispatch(self): if not hasattr(request, "jsonrequest"): wsr = request.env["website.seo.redirection"] + # Requests at this point have no user, must remove `env` to force + # Odoo recompute it next time a controller needs it, with its user + del request.env + try: # Redirect user to SEO version of this URL if possible return wsr.redirect_auto()