diff options
| author | Barry Warsaw | 2012-04-07 15:59:30 -0600 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-07 15:59:30 -0600 |
| commit | 7abcd4faa1553fb012020b6204fb8b6208fa5bf2 (patch) | |
| tree | a10fdad6d006c79e83997aa46401667eb61457e0 /src/mailman/model/user.py | |
| parent | 98169dac0fc89c4846b8396373b58be34c749f8e (diff) | |
| download | mailman-7abcd4faa1553fb012020b6204fb8b6208fa5bf2.tar.gz mailman-7abcd4faa1553fb012020b6204fb8b6208fa5bf2.tar.zst mailman-7abcd4faa1553fb012020b6204fb8b6208fa5bf2.zip | |
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: |
