changeset 935:5e8c7d78abd5 beta

fixes #98 protection against float division of percentage stats
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 09 Jan 2011 14:03:22 +0100
parents 4f930dc0023d
children e1c9903d7e38
files rhodecode/controllers/admin/repos.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/admin/repos.py	Fri Jan 07 13:28:05 2011 +0100
+++ b/rhodecode/controllers/admin/repos.py	Sun Jan 09 14:03:22 2011 +0100
@@ -285,7 +285,7 @@
 
         c.repo_last_rev = r.revisions[-1] if r.revisions else 0
 
-        if last_rev == 0:
+        if last_rev == 0 or c.repo_last_rev == 0:
             c.stats_percentage = 0
         else:
             c.stats_percentage = '%.2f' % ((float((last_rev)) /