Skip to content

Commit

Permalink
ZO-4267: Simplify spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
wosc committed Mar 4, 2024
1 parent 49bad2d commit 8139398
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/src/zeit/connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,9 @@ def locked(self, id):
# The resource does not exist on the server. This means it *cannot*
# be locked.
davlock = {}
owner = davlock.get('owner')
timeout = davlock.get('timeout')
token = davlock.get('locktoken')
mylock = None

owner = davlock.get('owner')
mylock = False
if davlock and owner:
# Let's see if the principal is one we know.
try:
Expand All @@ -435,16 +433,17 @@ def locked(self, id):
except zope.authentication.interfaces.PrincipalLookupError:
pass
else:
mylock = (token, owner, timeout)
mylock = True

timeout = davlock.get('timeout')
if timeout == 'Infinite':
timeout = TIME_ETERNITY
if timeout and timeout < datetime.datetime.now(pytz.UTC):
# The lock has timed out
self._invalidate_cache(id)
return self.locked(id)

return (owner, timeout, mylock is not None)
return (owner, timeout, mylock)

def search(self, attrlist, expr):
"""Search repository behind this connector according to <expr>.
Expand Down

0 comments on commit 8139398

Please sign in to comment.