From 4a88d096326b471304ea0915838ef9fc37e2055b Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 11 Jan 2021 11:35:22 +0000 Subject: [PATCH] [FIX] website: fix url_for when no qs Before this commit, old url was not rewrited in case you don't have any query string. X-original-commit: 959774b18283abe0c5a5c5ca0d379a1dda1d7a36 --- addons/http_routing/models/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index e1e69f94861..96a795ae17c 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -195,7 +195,7 @@ def url_for(url_from, lang_code=None, no_rewrite=False): and not path.startswith('/web/') )): new_url = request.env['ir.http'].url_rewrite(path) - new_url = new_url and qs and new_url + '?%s' % qs + new_url = new_url if not qs else new_url + '?%s' % qs return url_lang(new_url or url_from, lang_code=lang_code)