aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/rest/lists.py
diff options
context:
space:
mode:
authorJ08nY2017-06-22 15:13:30 +0200
committerJ08nY2017-06-22 15:13:30 +0200
commitefd5ddb06e1970be7d8b519d0ff77acc7a95da5e (patch)
treec395494d07050379f7365cf3e76e4df5a75fd889 /src/mailman_pgp/rest/lists.py
parent1683c0e288d65d2cb99c118a98f8b581ebd492dc (diff)
downloadmailman-pgp-efd5ddb06e1970be7d8b519d0ff77acc7a95da5e.tar.gz
mailman-pgp-efd5ddb06e1970be7d8b519d0ff77acc7a95da5e.tar.zst
mailman-pgp-efd5ddb06e1970be7d8b519d0ff77acc7a95da5e.zip
Diffstat (limited to 'src/mailman_pgp/rest/lists.py')
-rw-r--r--src/mailman_pgp/rest/lists.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mailman_pgp/rest/lists.py b/src/mailman_pgp/rest/lists.py
index 8f4cf8b..18669ad 100644
--- a/src/mailman_pgp/rest/lists.py
+++ b/src/mailman_pgp/rest/lists.py
@@ -22,6 +22,7 @@ from mailman.rest.helpers import (
from public import public
from mailman_pgp.config import config
+from mailman_pgp.database import query
from mailman_pgp.model.list import EncryptedMailingList
@@ -39,7 +40,7 @@ class _EncryptedBase(CollectionMixin):
def _get_collection(self, request):
"""See `CollectionMixin`."""
- return config.db.session.query(EncryptedMailingList).all()
+ return query(EncryptedMailingList).all()
@public
@@ -53,7 +54,7 @@ class AllEncryptedLists(_EncryptedBase):
@public
class AnEncryptedList(_EncryptedBase):
def __init__(self, list_id):
- self._mlist = config.db.session.query(EncryptedMailingList).filter_by(
+ self._mlist = query(EncryptedMailingList).filter_by(
list_id=list_id).first()
def on_get(self, request, response):