summaryrefslogtreecommitdiff
path: root/talermerchantdemos
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-05-18 22:14:31 +0200
committerFlorian Dold <florian@dold.me>2021-05-18 22:14:31 +0200
commita5bedb7db9ceaa0342306f12f900914a8e9b4155 (patch)
tree47edc72bc63118e037e5abf6e28cc9d0385e0652 /talermerchantdemos
parentc2e57ec25e3fda1661aab706422d0cb3e19b1393 (diff)
downloadtaler-merchant-demos-a5bedb7db9ceaa0342306f12f900914a8e9b4155.tar.gz
taler-merchant-demos-a5bedb7db9ceaa0342306f12f900914a8e9b4155.tar.bz2
taler-merchant-demos-a5bedb7db9ceaa0342306f12f900914a8e9b4155.zip
unquote article name for summary
Diffstat (limited to 'talermerchantdemos')
-rw-r--r--talermerchantdemos/blog/blog.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index c84ab47..9722206 100644
--- 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