Commit 2d94f568 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Eteri

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 37d02a99
...@@ -78,7 +78,7 @@ class EncryptedPasswordMixin: ...@@ -78,7 +78,7 @@ class EncryptedPasswordMixin:
def _setEncodedPassword(self, value, format='default'): def _setEncodedPassword(self, value, format='default'):
password = getattr(aq_base(self), 'password', None) password = getattr(aq_base(self), 'password', None)
if password is None: if password is None or isinstance(password, basestring):
password = self.password = PersistentMapping() password = self.password = PersistentMapping()
self.password[format] = value 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