webapp: total_size is None if num_files is 0
authorHelmut Grohne <helmut@subdivi.de>
Thu, 25 Apr 2013 12:19:58 +0000 (14:19 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Thu, 25 Apr 2013 12:19:58 +0000 (14:19 +0200)
webapp.py

index 8e520e8..3603214 100755 (executable)
--- 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