gnunet-svn
[Top][All Lists]
Advanced

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

[taler-bank] branch master updated: not asking the currency to the user


From: gnunet
Subject: [taler-bank] branch master updated: not asking the currency to the user
Date: Wed, 02 Jun 2021 19:16:24 +0200

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

ms pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 1e18bfe  not asking the currency to the user
1e18bfe is described below

commit 1e18bfe33255a4337302ecc65edf8cba53862fae
Author: MS <ms@taler.net>
AuthorDate: Wed Jun 2 19:16:20 2021 +0200

    not asking the currency to the user
---
 talerbank/app/templates/wiretransfer.html | 25 ++++++++++++++-----------
 talerbank/app/views.py                    |  4 +++-
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/talerbank/app/templates/wiretransfer.html 
b/talerbank/app/templates/wiretransfer.html
index 0813d97..ad25726 100644
--- a/talerbank/app/templates/wiretransfer.html
+++ b/talerbank/app/templates/wiretransfer.html
@@ -47,21 +47,24 @@
       <br>
       <br>
       </p>
-        <form action="{{ url('wiretransfer-form') }}"
-              method="POST"
-              name="wire-transfer-form">
+      <form action="{{ url('wiretransfer-form') }}"
+            method="POST"
+            name="wire-transfer-form">
         <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token 
}}" />
         <input name="receiver" placeholder={{ _("receiver") }} />
-       <br>
-       <br>
+        <br>
+        <br>
         <input name="subject" placeholder={{ _("subject") }} />
-       <br>
-       <br>
+        <br>
+        <br>
         <input name="amount"
-              placeholder={{ _("amount (CURRENCY:X.YY)") }}
-              pattern="{{ currency }}:[0-9]+(\.[0-9]+)?"/>
-       <br>
-       <br>
+               placeholder={{ _("amount") }}
+               pattern="[0-9]+(\.[0-9]+)?" />
+        <input readonly=""
+               name="currency"
+               value={{ currency }} />
+        <br>
+        <br>
         <input class="pure-button pure-button-primary" type="submit" value={{ 
_("Confirm") }} />
       </form>
       <p><a href="{{ url('payto-form') }}">Want to try the raw 
payto://-format?</a></p>
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index e6a09ed..d03faee 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -307,7 +307,9 @@ def wiretransfer_form(request):
 
     # A payment was submitted. 
     try:
-        amount = Amount.parse(request.POST.get("amount"))
+        amount = Amount.parse(
+            "{}:{}".format(request.POST.get("currency"), 
request.POST.get("amount")
+        ))
     except Exception:
         set_session_hint(request, success=False, hint="Wrong amount 
specified.")
         return redirect("wiretransfer-form")

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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