[Mpuls-commits] r1826 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 26 08:24:13 CET 2010


Author: torsten
Date: 2010-02-26 08:24:13 +0100 (Fri, 26 Feb 2010)
New Revision: 1826

Modified:
   wasko/branches/2.0/mpulsweb/controllers/case.py
Log:
* mpulsweb/controllers/case.py (CaseController._markForAnonymize),
(CaseController.anonymize): Use new anonymization related functions
from model.case.


Modified: wasko/branches/2.0/mpulsweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/case.py	2010-02-26 07:21:52 UTC (rev 1825)
+++ wasko/branches/2.0/mpulsweb/controllers/case.py	2010-02-26 07:24:13 UTC (rev 1826)
@@ -10,8 +10,8 @@
 from mpulsweb.lib.navigation import get_navigation
 from mpulsweb.lib.security import checkRole
 from mpulsweb.lib.validators import SetStandinForm, SetEditorForm
-from mpulsweb.lib.anonymize import check_state, anonymize, \
-    AnonymizeCheckException, determineAnonymizedCaseEndPhase
+from mpulsweb.lib.anonymize import determineAnonymizedCaseEndPhase
+from mpulsweb.model.case import ConsistenceCheckException 
 from mpulsweb.model.user import UserGroupList, UserListObject
 
 from mpulsweb.controllers.formularpage import get_rendered_page
@@ -150,8 +150,8 @@
 
         # First check if the case is in a state which allows anonymization 
         try:
-            check_state(case)
-        except AnonymizeCheckException, e:
+            case.check_consistence()
+        except ConsistenceCheckException, e:
             c.dialog_title =  MARKANONYMIZE_FAILED
             c.dialog_text  =  e.value 
             c.url_ok = url
@@ -162,7 +162,7 @@
         if confirmed == 1:
             # Anonymize case. Ensure that the case is in a consistent state
             # after anonymization.
-            anonymize(case)
+            case.make_anonymizable()
             c.dialog_title = MARKANONYMIZE_SUCCESS
             c.dialog_text = MARKANONYMIZE_SUCCESS_TEXT
             c.url_ok = h.url_for(controller="/case_overview")
@@ -186,8 +186,8 @@
 
         # First check if the case is in a state which allows anonymization 
         try:
-            check_state(case)
-        except AnonymizeCheckException, e:
+            case.check_consistence()
+        except ConsistenceCheckException, e:
             c.dialog_title =  MARKANONYMIZE_FAILED
             c.dialog_text  =  e.value 
             c.url_ok = "/case/digest/%s" % id



More information about the Mpuls-commits mailing list