gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontends] branch master updated: don't sho


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontends] branch master updated: don't show article after it was refunded
Date: Sun, 15 Oct 2017 21:39:16 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant-frontends.

The following commit(s) were added to refs/heads/master by this push:
     new 92d6c46  don't show article after it was refunded
92d6c46 is described below

commit 92d6c46ad05e332d3f0be44d01422dd748974674
Author: Florian Dold <address@hidden>
AuthorDate: Sun Oct 15 21:38:59 2017 +0200

    don't show article after it was refunded
---
 talerfrontends/blog/blog.py                | 12 +++++++-----
 talerfrontends/blog/static/web-common      |  2 +-
 talerfrontends/donations/static/web-common |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/talerfrontends/blog/blog.py b/talerfrontends/blog/blog.py
index 42cdbb0..def519d 100644
--- a/talerfrontends/blog/blog.py
+++ b/talerfrontends/blog/blog.py
@@ -33,8 +33,8 @@ import datetime
 from pprint import pprint
 from talerfrontends.talerconfig import TalerConfig
 from talerfrontends.helpers import (make_url,
-expect_parameter, join_urlparts, get_query_string,
-backend_error)
+        expect_parameter, join_urlparts, get_query_string,
+        backend_error)
 from talerfrontends.blog.content import (articles,
 get_article_file, get_image_file)
 
@@ -80,9 +80,6 @@ def javascript_licensing():
 # Will be triggered by a "refund button".
 @app.route("/refund", methods=["GET", "POST"])
 def refund():
-
-    # In production, will fetch this value from the state
-
     if flask.request.method == "POST":
         payed_articles = flask.session["payed_articles"] = 
flask.session.get("payed_articles", {})
         article_name = flask.request.form.get("article_name")
@@ -99,6 +96,7 @@ def refund():
                                     instance=INSTANCE))
         if 200 != r.status_code:
             return backend_error(r)
+        payed_articles[article_name] = "__refunded"
         response = flask.make_response()
         response.headers["X-Taler-Refund-Url"] = make_url("/refund", 
("order_id", order_id))
         return response, 402
@@ -160,6 +158,10 @@ def cc_payment(name):
 def article(name, data=None):
     logger.info("processing %s" % name)
     payed_articles = flask.session.get("payed_articles", {})
+
+    if payed_articles.get(name, "") == "__refunded":
+        return flask.render_template("templates/article_refunded.html", 
article_name=name)
+
     if name in payed_articles:
         article = articles[name]
         if article is None:
diff --git a/talerfrontends/blog/static/web-common 
b/talerfrontends/blog/static/web-common
index 43278f1..22a8423 160000
--- a/talerfrontends/blog/static/web-common
+++ b/talerfrontends/blog/static/web-common
@@ -1 +1 @@
-Subproject commit 43278f112f1b3e3f9bbf35574c09413527e40294
+Subproject commit 22a84231b7b831d8cd92b4076456568d7d5730be
diff --git a/talerfrontends/donations/static/web-common 
b/talerfrontends/donations/static/web-common
index 43278f1..22a8423 160000
--- a/talerfrontends/donations/static/web-common
+++ b/talerfrontends/donations/static/web-common
@@ -1 +1 @@
-Subproject commit 43278f112f1b3e3f9bbf35574c09413527e40294
+Subproject commit 22a84231b7b831d8cd92b4076456568d7d5730be

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]