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.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py
index c177388af..90d1c686c 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, PendedKeyValue
from mailman.utilities.queries import QuerySequence
from pickle import dumps, loads
from public import public
@@ -139,6 +140,15 @@ class ListRequests:
getUtility(IPendings).confirm(request.data_hash)
store.delete(request)
+ @dbconnection
+ def clear(self, store):
+ for token, pendable in getUtility(IPendings).find(
+ mlist=self.mailing_list,
+ confirm=False):
+ pended = store.query(Pended).filter_by(token=token).first()
+ store.query(PendedKeyValue).filter_by(pended_id=pended.id).delete()
+ store.delete(pended)
+
class _Request(Model):
"""Table for mailing list hold requests."""