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: handle 0-lenght histori


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: handle 0-lenght histories as of pagination
Date: Tue, 16 Jan 2018 12:11:45 +0100

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 ce5cc25  handle 0-lenght histories as of pagination
ce5cc25 is described below

commit ce5cc25e16eb3a9a025e69d45ca9e8f319aca428
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jan 16 12:11:02 2018 +0100

    handle 0-lenght histories as of pagination
---
 talerbank/app/views.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index d5ad6fe..c06a740 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -384,12 +384,16 @@ def serve_public_accounts(request, name=None, page=None):
         user.bankaccount, DELTA,
         -1 if youngest < 2 else youngest, "-")
 
-    num_pages = request.session["public_history_account"][0] / DELTA
+    num_pages = max(
+        request.session["public_history_account"][0] / DELTA),
+        1)
+
     pages = list(
         range(max(1, page - 3),
               # need +1 because the range is not inclusive for
               # the upper limit.
               min(page + 4, (math.ceil(num_pages) + 1))))
+
     context = dict(
         current_page=page,
         back = page - 1 if pages[0] > 1 else None,

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



reply via email to

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