From ef37242e94698d13ecdf2448c77a0fc3148918cb Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 23 May 2019 14:24:38 +0200 Subject: Remove (breaking) call to old API. --- talerbank/app/views.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'talerbank/app/views.py') 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)) -- cgit v1.2.3