taler-merchant-demos

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

commit ae73a85e2047b405d1fe8cf78aa5556673eec0d5
parent 376aedb143a62bcd09b0b6eaf512bc2fa9ba9ed8
Author: Florian Dold <florian.dold@gmail.com>
Date:   Wed, 19 Aug 2020 16:11:45 +0530

set cookie in the right place

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

diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py @@ -218,7 +218,6 @@ def article(article_name, data=None): ) order_resp = backend_post(BACKEND_URL, "private/orders", dict(order=order)) order_id = order_resp["order_id"] - flask.request.set_cookie("order_id", path=f"/essay/{article_name}") # Ask the backend for the status of the payment pay_status = backend_get( @@ -237,7 +236,9 @@ def article(article_name, data=None): ) else: return render_article(article_name, data, order_id) - else: - # Redirect the browser to a page where the wallet can - # run the payment protocol. - return flask.redirect(pay_status["order_status_url"]) + + # 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}") + return response