From efb9f88ad9645fc5f56508692ee38b4b0985b986 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 7 Jun 2021 15:55:41 +0200 Subject: [PATCH] bugfix/remove-list-initialization --- files/cache.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/cache.py b/files/cache.py index d3216d9..4c9f037 100644 --- a/files/cache.py +++ b/files/cache.py @@ -87,10 +87,10 @@ def validateGroups(self, username:str, groups:list): Returns True if the groups are valid for the user, False otherwise ''' if username in self.cache: - self.logs.info({'message':'Validating groups via cache.', 'username': username}) matchedGroups = [] matchesByGroup = [] cacheGroups = self.cache[username]['matchedGroups'] + self.logs.info({'message':'Validating groups via cache.', 'username': username, 'cacheGroups': ','.join(cacheGroups)}) for group in groups: matches = list(filter(None,list(map(self.__findMatch__, repeat(group), cacheGroups)))) if matches: @@ -112,7 +112,6 @@ def validateGroups(self, username:str, groups:list): return False,[] self.logs.warning({'message':'Invalid groups from cache.', 'username': username, 'conditional': self.groupConditional}) - self.cache[username]['matchedGroups'] = [] return False,[] self.logs.info({'message':'User not found in the cache for validate groups.', 'username': username})