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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 22 15:03:00 CEST 2010


Author: torsten
Date: 2010-04-22 15:02:59 +0200 (Thu, 22 Apr 2010)
New Revision: 2486

Modified:
   wasko/branches/2.0/mpulsweb/controllers/privacy.py
Log:
* mpulsweb/controllers/privacy.py (PrivacyController.decline): Get
	minimal fields to decline the privacy statement from config file


Modified: wasko/branches/2.0/mpulsweb/controllers/privacy.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/privacy.py	2010-04-22 13:01:45 UTC (rev 2485)
+++ wasko/branches/2.0/mpulsweb/controllers/privacy.py	2010-04-22 13:02:59 UTC (rev 2486)
@@ -11,10 +11,8 @@
 from mpulsweb.lib.anonymize import determineAnonymizedCaseEndPhaseName
 from mpulsweb.model.phase import ConsistenceCheckException
 
-from mpulsweb.controllers.case import PRIVACY_DECLINE, \
-     PRIVACY_DECLINE_TEXT, MARKANONYMIZE_CONFIRM_TEXT, MARKANONYMIZE_SUCCESS, \
-     MARKANONYMIZE_SUCCESS_TEXT, MARKANONYMIZE_FAILED, PRIVACY_DECLINE_DISALLOWED, \
-     PRIVACY_DECLINE_DISALLOWED_TEXT
+from mpulsweb.controllers.case import MARKANONYMIZE_CONFIRM_TEXT, \
+     MARKANONYMIZE_SUCCESS, MARKANONYMIZE_SUCCESS_TEXT, MARKANONYMIZE_FAILED
 
 HEADER = _("Set declaration of consent?")
 
@@ -26,7 +24,16 @@
 SET_EE_ACCEPT_SUCCESS_TEXT = u"""\
 Bitte klicken Sie auf "OK", um mit der Bearbeitung der Fallakte fortzufahren."""
 
+PRIVACY_DECLINE_DISALLOWED = _('Decline privacy statement not possible')
 
+PRIVACY_DECLINE_DISALLOWED_TEXT = _('The case is in a non consistent state und it will not be possible to anonimise it after retracting the privacy statement. The reason for this is listed below:<br>%s')
+
+PRIVACY_DECLINE = u"""Erklärung zurückziehen?"""
+PRIVACY_DECLINE_TEXT = u"""Die Akte wird anonymisiert, falls die Erklärung
+zurückgezogen wird."""
+
+
+
 log = logging.getLogger(__name__)
 
 
@@ -99,16 +106,12 @@
         # relevant date fields plus additionally some fields (e.g type of end
         # of cm)
 
-        # TODO: Get minimum fields from mpuls_config
-        #min_fields = g.mpuls_config...
-        min_fields = [] # Check all fields
+        min_fields = g.mpuls_config.get('phases', 'minimal_fields_to_anonymize') 
         try:
-            case.check_anonymizeability(min_fields)
+            case.check_anonymizeability(fields=min_fields, only_on_endphase=False)
         except ConsistenceCheckException, e:
-            #c.dialog_title = MARKANONYMIZE_FAILED
-            #c.dialog_text = h.literal(e.value)
             c.dialog_title = PRIVACY_DECLINE_DISALLOWED
-            c.dialog_text = PRIVACY_DECLINE_DISALLOWED_TEXT
+            c.dialog_text = h.literal(PRIVACY_DECLINE_DISALLOWED_TEXT % e.value)
             c.url_ok = h.url_for(controller='/case', action='digest',
                                  id=case.id)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')



More information about the Mpuls-commits mailing list