diff options
Diffstat (limited to 'src/mailman/model/user.py')
| -rw-r--r-- | src/mailman/model/user.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mailman/model/user.py b/src/mailman/model/user.py index 11c719eea..9ca9b5aea 100644 --- a/src/mailman/model/user.py +++ b/src/mailman/model/user.py @@ -27,13 +27,15 @@ __all__ = [ from storm.locals import ( DateTime, Int, RawStr, Reference, ReferenceSet, Unicode) from storm.properties import UUID +from zope.event import notify from zope.interface import implements from mailman.config import config from mailman.database.model import Model from mailman.interfaces.address import ( AddressAlreadyLinkedError, AddressNotLinkedError) -from mailman.interfaces.user import IUser, UnverifiedAddressError +from mailman.interfaces.user import ( + IUser, PasswordChangeEvent, UnverifiedAddressError) from mailman.model.address import Address from mailman.model.preferences import Preferences from mailman.model.roster import Memberships @@ -52,7 +54,7 @@ class User(Model): id = Int(primary=True) display_name = Unicode() - password = RawStr() + _password = RawStr(name='password') _user_id = UUID() _created_on = DateTime() @@ -88,6 +90,15 @@ class User(Model): """See `IUser`.""" return self._created_on + @property + def password(self): + return self._password + + @password.setter + def password(self, new_password): + self._password = new_password + notify(PasswordChangeEvent(self)) + def link(self, address): """See `IUser`.""" if address.user is not None: |
