changeset 34:a9f2e8fd8970

'NoneType' time values don't break getan while switching time mode anymore (issue1575).
author Ingo Weinzierl <ingo_weinzierl@web.de>
date Thu, 02 Sep 2010 20:26:52 +0200
parents f96a18c10836
children cfa9e755a5d2
files ChangeLog getan/view.py
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 31 19:37:37 2010 +0200
+++ b/ChangeLog	Thu Sep 02 20:26:52 2010 +0200
@@ -1,3 +1,10 @@
+2010-09-02  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  ISSUE1575
+
+	* getan/view.py: Verify that time values are not null before adding them to
+	  total time. Avoids getan crashing while switching the time mode.
+
 2010-08-31  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	* getan.py, getan/backend.py: Made getan Python-2.4 compatible.
--- a/getan/view.py	Tue Aug 31 19:37:37 2010 +0200
+++ b/getan/view.py	Thu Sep 02 20:26:52 2010 +0200
@@ -191,7 +191,9 @@
         logger.debug("ProjectList: update projects total time.")
         total = 0
         for proj in self.rows:
-            total += proj._get_time()
+            tmp = proj._get_time()
+            if tmp and type(tmp) == int:
+                total += tmp
         self.frame.set_footer(urwid.AttrWrap(
             urwid.Text(' Alle Projekte: %s %s'
                        % (proj.mode[1],human_time(total))), 'project_footer'))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)