summaryrefslogtreecommitdiff
path: root/talerbank/app/views.py
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-19 11:46:27 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2020-01-08 11:19:52 -0500
commit6e1c200a88f321a2f41ba56ea34b9ed1b9ef6e4a (patch)
tree90e12ce23b84655983fd98dc05f51e74879afafc /talerbank/app/views.py
parent0a2cc0a9b519ba5a4ee2ff0b73137c7e7846180b (diff)
downloadbank-6e1c200a88f321a2f41ba56ea34b9ed1b9ef6e4a.tar.gz
bank-6e1c200a88f321a2f41ba56ea34b9ed1b9ef6e4a.tar.bz2
bank-6e1c200a88f321a2f41ba56ea34b9ed1b9ef6e4a.zip
Switch to new date format.
Diffstat (limited to 'talerbank/app/views.py')
-rw-r--r--talerbank/app/views.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 4f36ba6..4dfab7a 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -754,7 +754,7 @@ def build_history_response(qs, cancelled, user_account):
sign=sign_,
wt_subject=entry.subject,
row_id=entry.id,
- date="/Date(" + str(int(entry.date.timestamp())) + ")/",
+ date=dict(t_ms=int(entry.date.timestamp())*1000)
)
)
return history
@@ -1035,10 +1035,12 @@ def api_withdraw_operation(request, withdraw_id):
def check_transfer_allowed(balance, balance_is_debit, debt_limit, transfer_amount):
- if amount_is_debit:
- total_debt = Amount(**transfer_amount).add(balance)
+ if balance_is_debit:
+ total_debt = Amount(**transfer_amount.dump())
+ total_debt.add(balance)
return Amount.cmp(total_debt, debt_limit) <= 0
- max_transfer = Amount(**balance).add(debt_limit)
+ max_transfer = Amount(**balance.dump())
+ max_transfer.add(debt_limit)
return Amount.cmp(transfer_amount, max_transfer) <= 0