[Mpuls-commits] r3945 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 8 20:08:03 CEST 2010


Author: bh
Date: 2010-10-08 20:08:01 +0200 (Fri, 08 Oct 2010)
New Revision: 3945

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
* mpulsweb/controllers/evaluate.py (EvaluateController.evaluate):
Do not instantiate the EvaluationConfig with an actual db
connection.  It will never be used and the previous code would
even recycle the connection immediately after instantiating
EvaluationConfig and before it was actually used.  This change
also remove one exception handler that would let the evaluate
method proceed even if the EvaluationConfig object could not be
created even though in that case nothing useful could be done at
all.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-08 17:54:46 UTC (rev 3944)
+++ base/trunk/ChangeLog	2010-10-08 18:08:01 UTC (rev 3945)
@@ -1,5 +1,17 @@
 2010-10-08  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/evaluate.py (EvaluateController.evaluate):
+	Do not instantiate the EvaluationConfig with an actual db
+	connection.  It will never be used and the previous code would
+	even recycle the connection immediately after instantiating
+	EvaluationConfig and before it was actually used.  This change
+	also remove one exception handler that would let the evaluate
+	method proceed even if the EvaluationConfig object could not be
+	created even though in that case nothing useful could be done at
+	all.
+
+2010-10-08  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/evaluate.py
 	(EvaluateController.evaluateAction): There's no need to apply
 	htmlfill to the rendered evaluation result because it doesn't

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2010-10-08 17:54:46 UTC (rev 3944)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2010-10-08 18:08:01 UTC (rev 3945)
@@ -99,18 +99,8 @@
         return self.evaluate(id)
 
     def evaluate(self, id=None):
-        conn, cur = None, None
-        try:
-            try:
-                config_file = get_configfile(id)
-                conn = db.getConnection()
-                c.evalconfig = EvaluationConfig(config_file, conn, None, None,
-                                                None, None, None, None, None)
-            except:
-                log.exception(_('Error: Evaluation failed'))
-        finally:
-            db.recycleConnection(conn, cur)
-
+        c.evalconfig = EvaluationConfig(get_configfile(id), None, None, None,
+                                        None, None, None, None, None)
         c.evaloptions = get_search_options(session.get('evaluation.options'),
                                            id,
                                            session.get("evaluation_ids", ()))



More information about the Mpuls-commits mailing list