summaryrefslogtreecommitdiff
path: root/talerbank/app/views.py
diff options
context:
space:
mode:
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))