Skip to content

Commit ee11e6a

Browse files
authored
Merge pull request #23 from dignajar/bugfix/remove-list-initialization
bugfix Remove list initialization
2 parents 6aedb76 + efb9f88 commit ee11e6a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

files/cache.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def validateGroups(self, username:str, groups:list):
8787
Returns True if the groups are valid for the user, False otherwise
8888
'''
8989
if username in self.cache:
90-
self.logs.info({'message':'Validating groups via cache.', 'username': username})
9190
matchedGroups = []
9291
matchesByGroup = []
9392
cacheGroups = self.cache[username]['matchedGroups']
93+
self.logs.info({'message':'Validating groups via cache.', 'username': username, 'cacheGroups': ','.join(cacheGroups)})
9494
for group in groups:
9595
matches = list(filter(None,list(map(self.__findMatch__, repeat(group), cacheGroups))))
9696
if matches:
@@ -112,7 +112,6 @@ def validateGroups(self, username:str, groups:list):
112112
return False,[]
113113

114114
self.logs.warning({'message':'Invalid groups from cache.', 'username': username, 'conditional': self.groupConditional})
115-
self.cache[username]['matchedGroups'] = []
116115
return False,[]
117116

118117
self.logs.info({'message':'User not found in the cache for validate groups.', 'username': username})

0 commit comments

Comments
 (0)