summaryrefslogtreecommitdiff
path: root/talerbank/app/views.py
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-05-23 14:24:38 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-05-23 14:24:38 +0200
commitef37242e94698d13ecdf2448c77a0fc3148918cb (patch)
tree49ad8d6d48b843ac001cd201cf6b5c9fb5fe51a5 /talerbank/app/views.py
parenta670306272f7ab051672ca8b721e7ac2e8e29d2a (diff)
downloadbank-stable.tar.gz
bank-stable.tar.bz2
bank-stable.zip
Remove (breaking) call to old API.stable
Diffstat (limited to 'talerbank/app/views.py')
-rw-r--r--talerbank/app/views.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 8f97acf..f4af47c 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -509,10 +509,14 @@ def serve_public_accounts(request, name=None, page=None):
if not user.bankaccount.is_public:
raise PrivateAccountException("Can't display public history for private account")
- num_records = query_history_raw(user.bankaccount,
- "both",
- start=-1, # makes sign ignored.
- sign="+").count()
+ # How many records does a user have.
+ num_records = query_history(user.bankaccount,
+ "both",
+ # Note: the parameter below is used for slicing arrays
+ # and django/python is not allowing slicing with big numbers.
+ (UINT64_MAX / 2 ) / 2,
+ start=0,
+ sign="+").count()
DELTA = 30
# '//' operator is NO floating point.
num_pages = max(num_records // DELTA, 1)
@@ -523,7 +527,7 @@ def serve_public_accounts(request, name=None, page=None):
history = extract_history(user.bankaccount,
True,
DELTA * page,
- -1,
+ 0,
"+")[DELTA * (page - 1):(DELTA * page)]
pages = list(range(1, num_pages + 1))