[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.
This commit is contained in:
@@ -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("|")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user