From f2ea1b9d5ba4dd3720417a2fdbccc03c06506efd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 7 Sep 2022 15:11:27 +0200 Subject: -try with url_for --- talermerchantdemos/blog/blog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'talermerchantdemos/blog') diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py index 6afee25..e264ca4 100644 --- a/talermerchantdemos/blog/blog.py +++ b/talermerchantdemos/blog/blog.py @@ -138,7 +138,7 @@ def internal_error(e): def index(): default = "en" target = flask.request.accept_languages.best_match(translations, default) - return flask.redirect(url_for ('index') + target + "/"), code=302) + return flask.redirect(url_for ('index') + target + "/", code=302) ## @@ -394,12 +394,12 @@ def article(article_name, lang=None, data=None): response.set_cookie( "order_id", ai, - path=urllib.parse.quote(url_for ('index') + f"essay/{article_name}")) + path=urllib.parse.quote(url_for ('index') + f"essay/{article_name}") ) response.set_cookie( "order_id", ai, - path=urllib.parse.quote(url_for ('index') + f"{lang}/essay/{article_name}")) + path=urllib.parse.quote(url_for ('index') + f"{lang}/essay/{article_name}") ) return response @@ -413,12 +413,12 @@ def article(article_name, lang=None, data=None): response.set_cookie( "order_id", order_id, - path=urllib.parse.quote(url_for ('index') + f"essay/{article_name}")) + path=urllib.parse.quote(url_for ('index') + f"essay/{article_name}") ) response.set_cookie( "order_id", order_id, - path=urllib.parse.quote(url_for ('index') + f"{lang}/essay/{article_name}")) + path=urllib.parse.quote(url_for ('index') + f"{lang}/essay/{article_name}") ) return response -- cgit v1.2.3