taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | Submodules | README | LICENSE

commit a5bedb7db9ceaa0342306f12f900914a8e9b4155
parent c2e57ec25e3fda1661aab706422d0cb3e19b1393
Author: Florian Dold <florian@dold.me>
Date:   Tue, 18 May 2021 22:14:31 +0200

unquote article name for summary

Diffstat:
Mtalermerchantdemos/blog/blog.py | 12+++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py @@ -286,11 +286,13 @@ def render_article(article_name, lang, data, order_id, refundable): # @param lang which language to use # def post_order(article_name, lang): + name_decoded = urllib.parse.unquote(article_name).replace("_", " ") + summary = f"Essay: {name_decoded}" order = dict( amount=ARTICLE_AMOUNT, extra=dict(article_name=article_name), fulfillment_url=flask.request.base_url, - summary="Essay: " + article_name.replace("_", " "), + summary=summary, # FIXME: add support for i18n of summary! # 10 minutes time for a refund wire_transfer_deadline=dict(t_ms=1000 * int(time.time() + 15 * 30)), @@ -397,12 +399,8 @@ def article(article_name, lang=None, data=None): # Redirect the browser to a page where the wallet can # run the payment protocol. response = flask.redirect(pay_status["order_status_url"]) - response.set_cookie( - "order_id", order_id, path=f"/essay/{article_name}" - ) - response.set_cookie( - "order_id", order_id, path=f"/{lang}/essay/{article_name}" - ) + response.set_cookie("order_id", order_id, path=f"/essay/{article_name}") + response.set_cookie("order_id", order_id, path=f"/{lang}/essay/{article_name}") return response