summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Bompard2016-02-12 18:03:24 +0100
committerBarry Warsaw2016-02-29 21:52:13 -0500
commitac2fdda2b90f0dcea205f494751335fcc93cddc5 (patch)
tree3ac1bafbaa907c40edec87db9f4285e9ce021275
parent1236a9cfc1546180a4717f0c8b9ba0d3c1f72e36 (diff)
downloadmailman-ac2fdda2b90f0dcea205f494751335fcc93cddc5.tar.gz
mailman-ac2fdda2b90f0dcea205f494751335fcc93cddc5.tar.zst
mailman-ac2fdda2b90f0dcea205f494751335fcc93cddc5.zip
-rw-r--r--src/mailman/model/mailinglist.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mailman/model/mailinglist.py b/src/mailman/model/mailinglist.py
index 1d7bdd3a3..6f59a1662 100644
--- a/src/mailman/model/mailinglist.py
+++ b/src/mailman/model/mailinglist.py
@@ -708,9 +708,8 @@ class HeaderMatchList:
@dbconnection
def clear(self, store):
"""See `IHeaderMatchList`."""
- store.query(HeaderMatch).filter(
- HeaderMatch.mailing_list == self._mailing_list).delete()
- store.expire(self._mailing_list, ['header_matches'])
+ # http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#deleting-from-collections
+ del self._mailing_list.header_matches[:]
@dbconnection
def append(self, store, header, pattern, action=None):