diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-07-10 22:00:17 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-07-10 22:00:17 +0200 |
commit | b11b20bd2beb1c498ebc02936f739f5e963ef23d (patch) | |
tree | 5b1e99d8734eec478cf2e7f03a73aec0ee4c1c2c /webapp.py | |
parent | dafdac5f00c1427249f037aaf542881cdbf8f0af (diff) | |
download | debian-dedup-b11b20bd2beb1c498ebc02936f739f5e963ef23d.tar.gz |
webapp: fix handling of total_size
The expression "total_size and 0" masks any positive integer to 0.
Diffstat (limited to 'webapp.py')
-rwxr-xr-x | webapp.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -256,11 +256,13 @@ class Application(object): row = conn.execute("SELECT count(filename), sum(size) FROM content WHERE package = ?;", (package,)).fetchone() num_files, total_size = row + if total_size is None: + total_size = 0 return dict(package=package, version=version, architecture=architecture, num_files=num_files, - total_size=total_size and 0) # total_size may be None + total_size=total_size) def get_dependencies(self, package): with self.db.begin() as conn: |