From 2e26dee08a3f4c7ad3f41c7b523f58cc61a1c8b1 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 25 Apr 2013 14:19:58 +0200 Subject: webapp: total_size is None if num_files is 0 --- webapp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp.py b/webapp.py index 8e520e8..3603214 100755 --- a/webapp.py +++ b/webapp.py @@ -253,6 +253,8 @@ class Application(object): cur.execute("SELECT count(filename), sum(size) FROM content WHERE package = ?;", (package,)) num_files, total_size = cur.fetchone() + if total_size is None: + total_size = 0 details.update(dict(num_files=num_files, total_size=total_size)) return details -- cgit v1.2.3