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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 19 16:33:02 CEST 2011


Author: bh
Date: 2011-08-19 16:33:00 +0200 (Fri, 19 Aug 2011)
New Revision: 5248

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCase.anonymize): Simplify the
implementation and remove the exception handlers. The callers can
deal with the exceptions now.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-08-19 13:45:55 UTC (rev 5247)
+++ base/trunk/ChangeLog	2011-08-19 14:33:00 UTC (rev 5248)
@@ -1,5 +1,11 @@
 2011-08-19  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/model/case.py (MpulsCase.anonymize): Simplify the
+	implementation and remove the exception handlers. The callers can
+	deal with the exceptions now.
+
+2011-08-19  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/case.py (CaseController.anonymize): Prepare
 	for the possibility that anonymizing a case may raise arbitrary
 	exception which will be the case when the meta-server is involved,

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-08-19 13:45:55 UTC (rev 5247)
+++ base/trunk/mpulsweb/model/case.py	2011-08-19 14:33:00 UTC (rev 5248)
@@ -1012,21 +1012,15 @@
 
     def anonymize(self):
         """Deleted personal data in the case"""
-        conn, cur = None, None
+        cur = None
+        conn = db.getConnection()
         try:
-            try:
-                conn = db.getConnection()
-                cur = conn.cursor()
-                d = {'id': self.id}
-                cur.execute(ANONYMIZE_CASE, d)
-            finally:
-                db.recycleConnection(conn, cur)
-            state = self.getState()
-            state.setState(5)
-            return True
-        except:
-            log.exception('Fehler beim Anonymisieren')
-        return False
+            cur = conn.cursor()
+            cur.execute(ANONYMIZE_CASE, {'id': self.id})
+        finally:
+            db.recycleConnection(conn, cur)
+        state = self.getState()
+        state.setState(5)
 
     def restore(self):
         #If case has no EE then set EE to undefined on restore



More information about the Mpuls-commits mailing list