app/soc/views/helper/access.py
changeset 2361 40b0c25a5793
parent 2257 7c0af7e05257
child 2380 f23025455742
equal deleted inserted replaced
2360:e389d26949db 2361:40b0c25a5793
   295     """
   295     """
   296 
   296 
   297     retention = 30
   297     retention = 30
   298 
   298 
   299     memcache_key = self.key(checker_name)
   299     memcache_key = self.key(checker_name)
       
   300     # pylint: disable-msg=E1101
   300     memcache.add(memcache_key, value, retention)
   301     memcache.add(memcache_key, value, retention)
   301 
   302 
   302   def get(self, checker_name):
   303   def get(self, checker_name):
   303     """Retrieves the result for the specified checker from cache.
   304     """Retrieves the result for the specified checker from cache.
   304     """
   305     """
   305 
   306 
   306     memcache_key = self.key(checker_name)
   307     memcache_key = self.key(checker_name)
       
   308     # pylint: disable-msg=E1101
   307     return memcache.get(memcache_key)
   309     return memcache.get(memcache_key)
   308 
   310 
   309   def doCheck(self, checker_name, django_args, args):
   311   def doCheck(self, checker_name, django_args, args):
   310     """Runs the specified checker with the specified arguments.
   312     """Runs the specified checker with the specified arguments.
   311     """
   313     """
   868         'role': role_name,
   870         'role': role_name,
   869         'status': 'group_accepted',
   871         'status': 'group_accepted',
   870         }
   872         }
   871 
   873 
   872     entity = request_logic.getForFields(fields, unique=True)
   874     entity = request_logic.getForFields(fields, unique=True)
   873 
   875     # pylint: disable-msg=E1103
   874     if entity and (entity.scope.status not in ['invalid', 'inactive']):
   876     if entity and (entity.scope.status not in ['invalid', 'inactive']):
   875       return
   877       return
   876 
   878 
   877     raise out_of_band.AccessViolation(message_fmt=DEF_NO_REQUEST_MSG)
   879     raise out_of_band.AccessViolation(message_fmt=DEF_NO_REQUEST_MSG)
   878 
   880