summaryrefslogtreecommitdiff
path: root/src/mailman/model/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/model/message.py')
-rw-r--r--src/mailman/model/message.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mailman/model/message.py b/src/mailman/model/message.py
index 3345c64c9..67c4caf79 100644
--- a/src/mailman/model/message.py
+++ b/src/mailman/model/message.py
@@ -17,8 +17,7 @@
"""Model for messages."""
-
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
@@ -28,8 +27,8 @@ __all__ = [
from storm.locals import AutoReload, Int, RawStr, Unicode
from zope.interface import implements
-from mailman.config import config
from mailman.database.model import Model
+from mailman.database.transaction import dbconnection
from mailman.interfaces.messages import IMessage
@@ -45,9 +44,10 @@ class Message(Model):
path = RawStr()
# This is a Messge-ID field representation, not a database row id.
- def __init__(self, message_id, message_id_hash, path):
+ @dbconnection
+ def __init__(self, store, message_id, message_id_hash, path):
super(Message, self).__init__()
self.message_id = message_id
self.message_id_hash = message_id_hash
self.path = path
- config.db.store.add(self)
+ store.add(self)