summaryrefslogtreecommitdiff
path: root/src/mailman/model/member.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-07-06 21:08:41 -0400
committerBarry Warsaw2012-07-06 21:08:41 -0400
commit8d8ab1655b51e277570005b445d3b014afcfbc57 (patch)
tree6ba0147d975636e129a787c9dfa64dae8cffae89 /src/mailman/model/member.py
parentcd3f84b301c2150fea5402129a2e7bc862fbb52b (diff)
parent01415190ab44e69a8f09a6411564a7cb288404e8 (diff)
downloadmailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.gz
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.zst
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.zip
Diffstat (limited to 'src/mailman/model/member.py')
-rw-r--r--src/mailman/model/member.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mailman/model/member.py b/src/mailman/model/member.py
index ae83fb388..b791ea0f2 100644
--- a/src/mailman/model/member.py
+++ b/src/mailman/model/member.py
@@ -17,7 +17,7 @@
"""Model for members."""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
@@ -27,11 +27,11 @@ __all__ = [
from storm.locals import Int, Reference, Unicode
from storm.properties import UUID
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
-from mailman.config import config
from mailman.core.constants import system_preferences
from mailman.database.model import Model
+from mailman.database.transaction import dbconnection
from mailman.database.types import Enum
from mailman.interfaces.action import Action
from mailman.interfaces.address import IAddress
@@ -46,8 +46,9 @@ uid_factory = UniqueIDFactory(context='members')
+@implementer(IMember)
class Member(Model):
- implements(IMember)
+ """See `IMember`."""
id = Int(primary=True)
_member_id = UUID()
@@ -176,7 +177,8 @@ class Member(Model):
# XXX Um, this is definitely wrong
return 'http://example.com/' + self.address.email
- def unsubscribe(self):
+ @dbconnection
+ def unsubscribe(self, store):
"""See `IMember`."""
- config.db.store.remove(self.preferences)
- config.db.store.remove(self)
+ store.remove(self.preferences)
+ store.remove(self)