gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] tag demo-2019-08-31-00 updated (a8e0e31 -> 820


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] tag demo-2019-08-31-00 updated (a8e0e31 -> 820685c)
Date: Sun, 01 Sep 2019 00:12:01 +0200

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

dold pushed a change to tag demo-2019-08-31-00
in repository bank.

*** WARNING: tag demo-2019-08-31-00 was modified! ***

    from a8e0e31  (commit)
      to 820685c  (commit)
    from a8e0e31  missing import
     add 820685c  don't error on consistent, repeated withdraw data

No new revisions were added by this update.

Summary of changes:
 talerbank/app/views.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 920bd04..3762ddf 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -900,11 +900,6 @@ def api_withdraw_operation(request, withdraw_id):
     host = request.get_host()
 
     if request.method == "POST":
-        if op.selection_done or op.withdraw_done:
-            return JsonResponse(
-                dict(error="selection of withdraw parameters already done"),
-                status=409
-            )
         data = json.loads(request.body.decode("utf-8"))
         exchange_payto_uri = data.get("selected_exchange")
         try:
@@ -919,12 +914,23 @@ def api_withdraw_operation(request, withdraw_id):
             return JsonResponse(
                 dict(error="bank accound in payto URI unknown"), status=400
             )
-        op.selected_exchange_account = exchange_acct
         selected_reserve_pub = data.get("reserve_pub")
         if not isinstance(selected_reserve_pub, str):
             return JsonResponse(
                 dict(error="reserve_pub must be a string"), status=400
             )
+        if op.selection_done or op.withdraw_done:
+            if (
+                op.selected_exchange_account != exchange_acct
+                or op.selected_reserve_pub != selected_reserve_pub
+            ):
+                return JsonResponse(
+                    dict(error="selection of withdraw parameters already 
done"),
+                    status=409
+                )
+            # No conflict, same data!
+            return JsonResponse(dict(), status=200)
+        op.selected_exchange_account = exchange_acct
         op.selected_reserve_pub = selected_reserve_pub
         op.selection_done = True
         op.save()

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



reply via email to

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