[Mpuls-commits] r1942 - wasko/branches/2.0/jmdweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 15 11:34:26 CET 2010


Author: torsten
Date: 2010-03-15 11:34:23 +0100 (Mon, 15 Mar 2010)
New Revision: 1942

Modified:
   wasko/branches/2.0/jmdweb/controllers/case.py
Log:
* jmdweb/controllers/case.py (checkPrivacyStatement): Deleted. Is now
	imported from lib/dialogs



Modified: wasko/branches/2.0/jmdweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/jmdweb/controllers/case.py	2010-03-15 10:32:53 UTC (rev 1941)
+++ wasko/branches/2.0/jmdweb/controllers/case.py	2010-03-15 10:34:23 UTC (rev 1942)
@@ -42,9 +42,9 @@
 from mpulsweb.lib.base import c, g, h, redirect_to, render, request, session
 from mpulsweb.lib.db import db
 from mpulsweb.lib.navigation import get_navigation
+from mpulsweb.lib.dialogs import checkPrivacyStatement 
 from mpulsweb.lib.security import checkRole
 
-from mpulsweb.model.appointment import CaseAppointmentFactory
 from mpulsweb.model.logbook import LogbookEntry
 
 from mpulsweb.controllers.formularpage import convert2dic
@@ -122,43 +122,6 @@
 Die Fallakte wurde erfolgreich importiert. Bitte klicken Sie auf "OK",
 um zur Fallaktenübersicht fortzufahren."""
 
-def checkPrivacyStatement(context='select'):
-    '''Decorator for the methods in the case controller'''
-    def validate(func, self, *args, **kwargs):
-        #load case and check if the statement is signed
-        if context == "showAppointment":
-            try:
-                app_id = int(args[0])
-                confirmed = int(args[1])
-            except:
-                raise HTTPNotFound()
-            app_factory = CaseAppointmentFactory()
-            app = app_factory.loadById(app_id)
-            case_id = app.case_id
-            c.targeturl = h.url_for(controller="/case",
-                                    action="showAppointment",
-                                    id=app_id, confirmed=1)
-        else:
-            try:
-                case_id = int(args[0])
-                confirmed = int(args[1])
-            except:
-                raise HTTPNotFound()
-            c.targeturl = h.url_for(controller="/case", action=context,
-                                    id=case_id, confirmed=1)
-
-        case = g.case_factory.loadById(case_id)
-
-        statement = case.getPrivacyStatement()
-        # Check if there is a "Einverstaendniserklaerung" None if it is
-        # not either signed or declined
-        if (not statement.isSigned() is None) or (confirmed == 1):
-            return func(self, *args, **kwargs)
-        else:
-            c.ds_id = case_id
-            return render('/privacy/dialogs/missing_statement.mako')
-    return decorator(validate)
-
 class CaseController(MpulsCaseController):
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))



More information about the Mpuls-commits mailing list