--- a/src/pyams_security/plugin/admin.py Wed Aug 02 09:05:58 2017 +0200
+++ b/src/pyams_security/plugin/admin.py Mon Sep 11 13:53:16 2017 +0200
@@ -48,11 +48,14 @@
@password.setter
def password(self, value):
- manager = get_utility(IPasswordManager, name='SSHA')
- self._password = manager.encodePassword(value)
+ if value:
+ manager = get_utility(IPasswordManager, name='SSHA')
+ self._password = manager.encodePassword(value)
+ else:
+ self._password = None
def authenticate(self, credentials, request):
- if not self.enabled:
+ if not (self.enabled and self.password):
return None
attrs = credentials.attributes
login = attrs.get('login')