Commit 978ecece authored by Tristan Cavelier's avatar Tristan Cavelier

Fix fails to _setEncodedPassword if password is a string

In some cases, a Person.password could be a string instead of
None or PersistentMapping. If string, the code was raising
TypeError.
parent 6ac0882f
......@@ -78,7 +78,7 @@ class EncryptedPasswordMixin:
def _setEncodedPassword(self, value, format='default'):
password = getattr(aq_base(self), 'password', None)
if password is None:
if password is None or isinstance(password, basestring):
password = self.password = PersistentMapping()
self.password[format] = value
......
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