[Mpuls-commits] r5151 - in base/trunk: . mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 1 20:23:56 CEST 2011


Author: bh
Date: 2011-07-01 20:23:53 +0200 (Fri, 01 Jul 2011)
New Revision: 5151

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCaseFactory.loadById): Log the
query before it's executed instead of afterwards, so that the
query string has been logged even if the execution fails because
of e.g. a syntax error in the query.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-07-01 08:34:54 UTC (rev 5150)
+++ base/trunk/ChangeLog	2011-07-01 18:23:53 UTC (rev 5151)
@@ -1,3 +1,10 @@
+2011-07-01  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/model/case.py (MpulsCaseFactory.loadById): Log the
+	query before it's executed instead of afterwards, so that the
+	query string has been logged even if the execution fails because
+	of e.g. a syntax error in the query.
+
 2011-06-24  Bernhard Herzog  <bh at intevation.de>
 
 	* contrib/scripts/cleanup-session-cache: New. Script to be used as

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-07-01 08:34:54 UTC (rev 5150)
+++ base/trunk/mpulsweb/model/case.py	2011-07-01 18:23:53 UTC (rev 5151)
@@ -1146,8 +1146,8 @@
             fields = self.case_cls.get_preload_fields()
             query = LOAD_CASE_SQL % dict(fields=", ".join(fields))
             fields = {'id': id}
+            log.debug("Query: %s", query)
             c.execute(query, fields)
-            log.debug("Query: %s" % c.query)
             result = c.fetchone()
             if not result:
                 raise LoadCaseNotExistsError("Es konnte keine Fallakte geladen"



More information about the Mpuls-commits mailing list