Commit 723fcb24 authored by Julien Muchembled's avatar Julien Muchembled

Compatibility with recent BTrees

Same as for commit c3450f14:
BTrees don't accept None as key anymore.
parent 839a2744
......@@ -266,7 +266,7 @@ class PasswordTool(BaseTool):
try:
register_user_login, expiration_date = self._password_request_dict[
password_key]
except KeyError:
except (KeyError, TypeError):
# XXX: incorrect grammar and not descriptive enough
return error('Key not known. Please ask reset password.')
if user_login is not None and register_user_login != user_login:
......
......@@ -209,18 +209,24 @@ class BTreeMappingDict(Implicit):
return self._getStorage().items()
def __getitem__(self, key):
if key is None:
raise KeyError(key)
return self._getStorage()[key]
def __contains__(self, key):
return key in self._getStorage().keys()
def get(self, key, default=None):
if key is None:
return default
return self._getStorage().get(key, default)
def __setitem__(self, key, value):
self._getStorage()[key] = value
def __delitem__(self, key):
if key is None:
raise KeyError(key)
del self._getStorage()[key]
InitializeClass(UrlRegistryTool)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment