[Mpuls-commits] r2263 - wasko/branches/2.0/mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Mar 31 15:05:15 CEST 2010
Author: torsten
Date: 2010-03-31 15:05:14 +0200 (Wed, 31 Mar 2010)
New Revision: 2263
Modified:
wasko/branches/2.0/mpulsweb/lib/dialogs.py
Log:
* mpulsweb/lib/dialogs.py (checkPrivacyStatement.validate): Only do
validation in privacy in case-modul is enabled
Modified: wasko/branches/2.0/mpulsweb/lib/dialogs.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/dialogs.py 2010-03-31 10:43:26 UTC (rev 2262)
+++ wasko/branches/2.0/mpulsweb/lib/dialogs.py 2010-03-31 13:05:14 UTC (rev 2263)
@@ -28,38 +28,45 @@
def checkPrivacyStatement(context='select'):
'''Decorator for the methods in the case controller'''
def validate(func, self, *args, **kwargs):
+ if not g.mpuls_config.is_enabled('case-module', 'privacy'):
+ log.debug('Privacy disabled... No checks on statement done')
+ return 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 = 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 = url_for(controller="/case", action=context,
- id=case_id, confirmed=1)
+ try:
+ 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 = 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 = url_for(controller="/case", action=context,
+ id=case_id, confirmed=1)
- case = g.case_factory.loadById(case_id)
+ 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')
+ 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')
+ except:
+ log.exception('Fehler in der Validierung')
+ raise
return decorator(validate)
More information about the Mpuls-commits
mailing list