aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/model/list.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/model/list.py')
-rw-r--r--src/mailman_pgp/model/list.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mailman_pgp/model/list.py b/src/mailman_pgp/model/list.py
index 838bcab..946af34 100644
--- a/src/mailman_pgp/model/list.py
+++ b/src/mailman_pgp/model/list.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
"""Model for PGP enabled mailing lists."""
-
+from lazr.config import as_boolean
from mailman.database.types import Enum, SAUnicode
from mailman.interfaces.action import Action
from mailman.interfaces.listmanager import (IListManager, ListDeletingEvent)
@@ -145,8 +145,12 @@ class PGPMailingList(Base):
@classhandler.handler(ListDeletingEvent)
def on_delete(event):
+ shred = as_boolean(config.get('keypairs', 'shred'))
pgp_list = PGPMailingList.for_list(event.mailing_list)
if pgp_list:
with transaction() as session:
- # TODO shred the list key
+ if shred:
+ pgp_list.fs_key.shred()
+ else:
+ pgp_list.fs_key.delete()
session.delete(pgp_list)