diff options
Diffstat (limited to 'src/mailman_pgp/rest/lists.py')
| -rw-r--r-- | src/mailman_pgp/rest/lists.py | 5 |
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): |
