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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Sep 13 20:39:24 CEST 2011


Author: bh
Date: 2011-09-13 20:39:23 +0200 (Tue, 13 Sep 2011)
New Revision: 5325

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
Port model-level meta-server actions for case-state changes from WASKU
to mpulsweb. The actions are deleting, anonymizing and marking for
anonymization.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-09-13 18:00:15 UTC (rev 5324)
+++ base/trunk/mpulsweb/model/case.py	2011-09-13 18:39:23 UTC (rev 5325)
@@ -65,6 +65,7 @@
      import_logbook
 from mpulsweb.model.meta import Meta
 
+
 log = logging.getLogger(__name__)
 
 PRESET_FIELDS_IN_MASTERTABLE = ['bearbeiter_id']
@@ -1004,14 +1005,29 @@
         """Delete the case from the data base.
         The method raises exceptions if the case cannot be deleted.
         """
+        if g.mpuls_config.is_enabled('case-module', 'meta-server'):
+            meta = self.getMeta()
+            if meta.is_linked():
+                meta.delete_projectdata()
+
         db.execute(DELETE_CASE_SQL, {'id': self.id})
 
     def markAnonymize(self):
         """Mark case for anonymization"""
+        if g.mpuls_config.is_enabled('case-module', 'meta-server'):
+            meta = self.getMeta()
+            if meta.is_linked():
+                meta.push()
+
         self.getState().setState(4)
 
     def anonymize(self):
         """Deleted personal data in the case"""
+        if g.mpuls_config.is_enabled('case-module', 'meta-server'):
+            meta = self.getMeta()
+            if meta.is_linked():
+                meta.push()
+
         cur = None
         conn = db.getConnection()
         try:



More information about the Mpuls-commits mailing list