summaryrefslogtreecommitdiff
path: root/talersurvey/survey/survey.py
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2017-11-28 12:41:36 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2017-11-28 12:41:36 +0100
commit3eff171197018323756b50fc8b61bb4a9fcda428 (patch)
tree4f49163830b7a157defca4cfebd3eb49504b586f /talersurvey/survey/survey.py
parente0cf85f8fb076f12ccd5870ed0925e243683274b (diff)
downloadsurvey-3eff171197018323756b50fc8b61bb4a9fcda428.tar.gz
survey-3eff171197018323756b50fc8b61bb4a9fcda428.tar.bz2
survey-3eff171197018323756b50fc8b61bb4a9fcda428.zip
returning backend data as stringified header
Diffstat (limited to 'talersurvey/survey/survey.py')
-rw-r--r--talersurvey/survey/survey.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/talersurvey/survey/survey.py b/talersurvey/survey/survey.py
index cf90e2f..6fcbbe7 100644
--- a/talersurvey/survey/survey.py
+++ b/talersurvey/survey/survey.py
@@ -93,12 +93,11 @@ def survey():
else:
success = True
- response = flask.make_response(flask.render_template("templates/index.html", success=success), 402)
- response.headers["X-Taler-Tipping-Url"] = urljoin(
- flask.request.base_url,
- flask.url_for("pick", tip_id=r.json().get("tip_id")))
- response.headers["X-Taler-Tipping-Exchange"] = r.json().get("exchange_uri")
- response.headers["X-Taler-Tipping-Amount"] = amount.stringify(2)
- response.headers["X-Taler-Tipping-Deadline"] = r.json().get("expiration")
+ response = flask.make_response(flask.render_template(
+ "templates/wait.html",
+ success=success),
+ 402)
+ tip_header = r.json().update({"pickup_url": urljoin(flask.request.base_url, "/pick")})
+ response.headers["X-Taler-Tip"] = json.dumps(tip_header)
return response