Skip to content

Commit

Permalink
Merge pull request #23 from dignajar/bugfix/remove-list-initialization
Browse files Browse the repository at this point in the history
bugfix Remove list initialization
  • Loading branch information
dignajar authored Jun 7, 2021
2 parents 6aedb76 + efb9f88 commit ee11e6a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions files/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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})
Expand Down

0 comments on commit ee11e6a

Please sign in to comment.