Ensure that accessViolations for Survey menu items get captured.
authorLennard de Rijk <ljvderijk@gmail.com>
Sun, 05 Jul 2009 12:57:09 +0200
changeset 2546 df7e4291c23c
parent 2545 0a93ce6a1e8f
child 2547 c7726e3ab173
Ensure that accessViolations for Survey menu items get captured. (Also ensure that you think before committing something you broke yourself :()
app/soc/views/models/survey.py
--- a/app/soc/views/models/survey.py	Sun Jul 05 12:19:19 2009 +0200
+++ b/app/soc/views/models/survey.py	Sun Jul 05 12:57:09 2009 +0200
@@ -852,15 +852,19 @@
         # check if the current user is allowed to visit the take Survey page
         allowed_to_take = False
 
-        rights.checkIsSurveyTakeable(
-            {'key_name': survey_entity.key().name(),
-             'prefix': survey_entity.prefix,
-             'scope_path': survey_entity.scope_path,
-             'link_id': survey_entity.link_id,
-             'user': user},
-            survey_logic,
-            check_time=False)
-        allowed_to_take = True
+        try:
+          rights.checkIsSurveyTakeable(
+              {'key_name': survey_entity.key().name(),
+               'prefix': survey_entity.prefix,
+               'scope_path': survey_entity.scope_path,
+               'link_id': survey_entity.link_id,
+               'user': user},
+              survey_logic,
+              check_time=False)
+          allowed_to_take = True
+        except:
+          pass
+
         # cache ACL for a given entity.taking_access
         survey_rights[survey_entity.taking_access] = allowed_to_take