app/soc/views/models/survey.py
changeset 2546 df7e4291c23c
parent 2543 4c95d717a976
child 2558 ba32a4f5716b
equal deleted inserted replaced
2545:0a93ce6a1e8f 2546:df7e4291c23c
   850         # we have not determined if this user has the given type of access
   850         # we have not determined if this user has the given type of access
   851 
   851 
   852         # check if the current user is allowed to visit the take Survey page
   852         # check if the current user is allowed to visit the take Survey page
   853         allowed_to_take = False
   853         allowed_to_take = False
   854 
   854 
   855         rights.checkIsSurveyTakeable(
   855         try:
   856             {'key_name': survey_entity.key().name(),
   856           rights.checkIsSurveyTakeable(
   857              'prefix': survey_entity.prefix,
   857               {'key_name': survey_entity.key().name(),
   858              'scope_path': survey_entity.scope_path,
   858                'prefix': survey_entity.prefix,
   859              'link_id': survey_entity.link_id,
   859                'scope_path': survey_entity.scope_path,
   860              'user': user},
   860                'link_id': survey_entity.link_id,
   861             survey_logic,
   861                'user': user},
   862             check_time=False)
   862               survey_logic,
   863         allowed_to_take = True
   863               check_time=False)
       
   864           allowed_to_take = True
       
   865         except:
       
   866           pass
       
   867 
   864         # cache ACL for a given entity.taking_access
   868         # cache ACL for a given entity.taking_access
   865         survey_rights[survey_entity.taking_access] = allowed_to_take
   869         survey_rights[survey_entity.taking_access] = allowed_to_take
   866 
   870 
   867         if not allowed_to_take:
   871         if not allowed_to_take:
   868           # not allowed to take this survey
   872           # not allowed to take this survey