gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] branch master updated: fix fields in history t


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: fix fields in history to pacify the exchange's bank-lib
Date: Mon, 15 May 2017 14:57:09 +0200

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

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 8c63853  fix fields in history to pacify the exchange's bank-lib
8c63853 is described below

commit 8c63853e39de238ddccc9886cf5de09e0692f032
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 11 16:01:42 2017 +0200

    fix fields in history to pacify the exchange's bank-lib
---
 talerbank/app/tests.py |  2 +-
 talerbank/app/views.py | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 2461124..da76fa6 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -166,7 +166,7 @@ class HistoryTestCase(TestCase):
                          **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
         data = response.content.decode("utf-8")
         data = json.loads(data)
-        self.assertEqual(data["data"][0]["subject"], "h")
+        self.assertEqual(data["data"][0]["wt_subject"], "h")
         # Get non-existent record: the latest plus one in the future: 
transaction "h" takes row_id 11
         response = c.get(reverse("history", urlconf=urls), {"auth": "basic", 
"delta": "1", "start": "11"},
                          **{"HTTP_X_TALER_BANK_USERNAME": "User", 
"HTTP_X_TALER_BANK_PASSWORD": "Password"})
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 7c1ef9a..20cb466 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -391,17 +391,17 @@ def history(request):
     if 0 == qs.count():
         return HttpResponse(status=204)
     for entry in qs:
-        counterpart = entry.credit_account.user.username
+        counterpart = entry.credit_account.account_no
         sign_ = "-"
-        if entry.credit_account.user.username == user_account.username:
-            counterpart = entry.debit_account.user.username
+        if entry.credit_account.account_no == 
user_account.bankaccount.account_no:
+            counterpart = entry.debit_account.account_no
             sign_ = "+"
         history.append(dict(counterpart=counterpart,
                             amount=entry.amount_obj,
                             sign=sign_,
-                            subject=entry.subject,
-                            row_id=entry.id))
-
+                            wt_subject=entry.subject,
+                            row_id=entry.id,
+                            date="/Date(" + str(int(entry.date.timestamp())) + 
")/"))
     return JsonResponse(dict(data=history), status=200)
 
 

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



reply via email to

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