summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman/model/requests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py
index 440b977a1..0c164172d 100644
--- a/src/mailman/model/requests.py
+++ b/src/mailman/model/requests.py
@@ -23,7 +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.model.pending import Pended, PendedKeyValue
from mailman.utilities.queries import QuerySequence
from pickle import dumps, loads
from public import public
@@ -145,7 +145,9 @@ class ListRequests:
for pended_token in getUtility(IPendings).find(
mlist=self.mailing_list,
confirm=False):
- store.query(Pended).filter_by(token=pended_token).delete()
+ pended = store.query(Pended).filter_by(token=pended_token).first()
+ store.query(PendedKeyValue).filter_by(pended_id=pended.id).delete()
+ store.delete(pended)
class _Request(Model):