[Mpuls-commits] r4008 - base/trunk/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 21 15:57:07 CEST 2010


Author: bh
Date: 2010-10-21 15:57:06 +0200 (Thu, 21 Oct 2010)
New Revision: 4008

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCaseBundle.export): Remove an
unnecessary exception handler.  The exception handler would handle
exceptions that happen during XML serialization by simply loggin
the exception and doing nothing else.  However, if XML
serialization fails nothing at all can be exported and in fact the
most likely thing that happens after handling the exception would
be another exception due to the local variable xmltree being
unbound.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-10-21 12:51:54 UTC (rev 4007)
+++ base/trunk/mpulsweb/model/case.py	2010-10-21 13:57:06 UTC (rev 4008)
@@ -424,13 +424,9 @@
     def export(self, type='XML', anonym=True, selection=None, ):
         factory = InstanceFactory(g.formedTree, PostgresDBInterface())
         num = 0
-        try:
-            xmltree = factory.toXML(self.case_list, 
-                                    selection=selection, 
-                                    anonymize=anonym)
-            num = len(self.case_list) 
-        except Exception, e:
-            log.exception(e)
+        xmltree = factory.toXML(self.case_list, selection=selection,
+                                anonymize=anonym)
+        num = len(self.case_list)
 
         if type == "XML":
             export = self._exportXML(xmltree) 



More information about the Mpuls-commits mailing list