From 0908cbd0e8032599f6cdbdafce5b72daaf970649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 19 May 2017 12:24:17 +0200 Subject: [PATCH] [IMP] website: ir_http: correctly call super in auth_method_public Calling super when it is possible it always a good practice. It ensures to have a basic behavior that is the fallback when the behavior defined in the inheritance does not apply. Previously the base behavior was done directly in the inheritance without calling super. This commit improves that and calls super like a pro. --- addons/website/models/ir_http.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 077a4622651..15e751e2b09 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -62,10 +62,8 @@ class Http(models.AbstractModel): website = env['website'].get_current_website() if website: request.uid = website.user_id.id - else: - request.uid = env.ref('base.public_user').id - else: - request.uid = request.session.uid + if not request.uid: + super(Http, cls)._auth_method_public() bots = "bot|crawl|slurp|spider|curl|wget|facebookexternalhit".split("|")