Skip to content

Commit

Permalink
optimize cache get by @ale-rt see #110
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jun 14, 2023
1 parent ab31dd8 commit c9de37e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pas/plugins/ldap/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ def _key(self):
def get(self):
request = getRequest()
rcachekey = self._key()
if request and rcachekey in list(request.keys()):
return request[rcachekey]
return VALUE_NOT_CACHED
return (request or {}).get(rcachekey, VALUE_NOT_CACHED)

def set(self, value):
request = getRequest()
Expand Down

0 comments on commit c9de37e

Please sign in to comment.