[Mpuls-commits] r3212 - jmd/trunk/jmdstrukturweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 21 10:26:48 CEST 2010


Author: torsten
Date: 2010-07-21 10:26:47 +0200 (Wed, 21 Jul 2010)
New Revision: 3212

Modified:
   jmd/trunk/jmdstrukturweb/model/appointment.py
Log:
* jmdstrukturweb/model/appointment.py (StatisticReminderOverview.get_recent_statistic): Make function more robust. If no case is stored in the db, return a empty dummy "recent case".


Modified: jmd/trunk/jmdstrukturweb/model/appointment.py
===================================================================
--- jmd/trunk/jmdstrukturweb/model/appointment.py	2010-07-21 07:30:52 UTC (rev 3211)
+++ jmd/trunk/jmdstrukturweb/model/appointment.py	2010-07-21 08:26:47 UTC (rev 3212)
@@ -43,12 +43,13 @@
             cur.execute(sql, {'maxdays': days})
             log.debug(cur.query)
             result = cur.fetchone()
-            
-            case = {'id': result[0], 'start': result[1], 'end': result[2]}
-            return case 
+           
+            if result is not None:
+                case = {'id': result[0], 'start': result[1], 'end': result[2]}
+                return case 
         finally:
             db.recycleConnection(conn, cur)
-        return False
+        return {} 
 
     def check_recent_statistic(self, days, user):
         conn, cur = None, None



More information about the Mpuls-commits mailing list