Commit 92776710 authored by Jérome Perrin's avatar Jérome Perrin

EncryptedPasswordMixin: py3

parent a0eba8b1
...@@ -82,6 +82,8 @@ class EncryptedPasswordMixin(object): ...@@ -82,6 +82,8 @@ class EncryptedPasswordMixin(object):
value, value,
format='default', # pylint: disable=redefined-builtin format='default', # pylint: disable=redefined-builtin
): ):
if value is not None and not isinstance(value, bytes):
value = value.encode()
password = getattr(aq_base(self), 'password', None) password = getattr(aq_base(self), 'password', None)
if password is None or isinstance(password, basestring): if password is None or isinstance(password, basestring):
password = self.password = PersistentMapping() password = self.password = PersistentMapping()
...@@ -111,8 +113,6 @@ class EncryptedPasswordMixin(object): ...@@ -111,8 +113,6 @@ class EncryptedPasswordMixin(object):
security.declareProtected(Permissions.AccessContentsInformation, 'getPassword') security.declareProtected(Permissions.AccessContentsInformation, 'getPassword')
def getPassword(self, *args, **kw): def getPassword(self, *args, **kw):
"""
"""
marker = [] marker = []
if len(args): if len(args):
default_password = args[0] default_password = args[0]
......
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