summaryrefslogtreecommitdiff
path: root/src/mailman/model/requests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/model/requests.py')
-rw-r--r--src/mailman/model/requests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py
index c177388af..440b977a1 100644
--- a/src/mailman/model/requests.py
+++ b/src/mailman/model/requests.py
@@ -23,6 +23,7 @@ from mailman.database.transaction import dbconnection
from mailman.database.types import Enum, SAUnicode
from mailman.interfaces.pending import IPendable, IPendings
from mailman.interfaces.requests import IListRequests, RequestType
+from mailman.model.pending import Pended
from mailman.utilities.queries import QuerySequence
from pickle import dumps, loads
from public import public
@@ -139,6 +140,13 @@ class ListRequests:
getUtility(IPendings).confirm(request.data_hash)
store.delete(request)
+ @dbconnection
+ def clear(self, store):
+ for pended_token in getUtility(IPendings).find(
+ mlist=self.mailing_list,
+ confirm=False):
+ store.query(Pended).filter_by(token=pended_token).delete()
+
class _Request(Model):
"""Table for mailing list hold requests."""