[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-blog] branch master updated: fix refund
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-blog] branch master updated: fix refund |
Date: |
Wed, 17 Jan 2018 03:54:45 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository blog.
The following commit(s) were added to refs/heads/master by this push:
new a50b35a fix refund
a50b35a is described below
commit a50b35a5a7f4956720aea8bd788d1f6df2e1887e
Author: Florian Dold <address@hidden>
AuthorDate: Wed Jan 17 03:54:41 2018 +0100
fix refund
---
talerblog/blog/blog.py | 8 ++++----
talerblog/blog/templates/article_frame.html | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/talerblog/blog/blog.py b/talerblog/blog/blog.py
index 08bb2cd..ddcaa0a 100644
--- a/talerblog/blog/blog.py
+++ b/talerblog/blog/blog.py
@@ -111,13 +111,12 @@ def javascript_licensing():
# Triggers the refund by serving /refund/test?order_id=XY.
# Will be triggered by a "refund button".
address@hidden("/refund", methods=["POST"])
-def refund():
address@hidden("/refund/<order_id>", methods=["POST"])
+def refund(order_id):
article_name = flask.request.form.get("article_name")
if not article_name:
return flask.jsonify(dict(error="No article_name found in form")), 400
LOGGER.info("Looking for %s to refund" % article_name)
- order_id = payed_articles.get(article_name)
if not order_id:
return flask.jsonify(dict(error="Aborting refund: article not
payed")), 401
resp = backend_post(urljoin(BACKEND_URL, "refund"),
@@ -188,7 +187,8 @@ def article(article_name, data=None):
return "permission denied", 403
return flask.render_template("templates/article_frame.html",
article_file=get_article_file(article_info),
- article_name=article_name)
+ article_name=article_name,
+ order_id=order_id)
# no pay_redirect but article not paid, this should never happen!
flask.abort(500)
diff --git a/talerblog/blog/templates/article_frame.html
b/talerblog/blog/templates/article_frame.html
index 50d58e2..596ffd7 100644
--- a/talerblog/blog/templates/article_frame.html
+++ b/talerblog/blog/templates/article_frame.html
@@ -1,7 +1,7 @@
{% extends "templates/base.html" %}
{% block main %}
{% include "articles/" + article_file %}
- <form action="/refund" method="POST">
+ <form action="{{ url_for('refund', order_id=order_id) }}" method="POST">
<input type="text" name="article_name" value={{ article_name}} hidden>
<input type="submit" value="Ask refund!">
</form>
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-blog] branch master updated: fix refund,
gnunet <=