aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Commands/cmd_unsubscribe.py
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2020-05-18 10:01:51 -0700
committerMark Sapiro <mark@msapiro.net>2020-05-18 10:01:51 -0700
commit248ca38ffb4821a131460c9953aa21d6fe7cec04 (patch)
tree0a9506f5eb6cf8ca369f3a18aa3e8be69c4d80f4 /Mailman/Commands/cmd_unsubscribe.py
parent6432a3277d824ce149cf0d105bab6b78a91821a4 (diff)
downloadmailman2-248ca38ffb4821a131460c9953aa21d6fe7cec04.tar.gz
mailman2-248ca38ffb4821a131460c9953aa21d6fe7cec04.tar.xz
mailman2-248ca38ffb4821a131460c9953aa21d6fe7cec04.zip
Extend REFUSE_SECOND_PENDING to unsubscription as well.
Diffstat (limited to '')
-rw-r--r--Mailman/Commands/cmd_unsubscribe.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Mailman/Commands/cmd_unsubscribe.py b/Mailman/Commands/cmd_unsubscribe.py
index 9ffa80cd..3a156536 100644
--- a/Mailman/Commands/cmd_unsubscribe.py
+++ b/Mailman/Commands/cmd_unsubscribe.py
@@ -73,9 +73,14 @@ approval."""))
# No password was given, so we need to do a mailback confirmation
# instead of unsubscribing them here.
cpaddr = mlist.getMemberCPAddress(address)
- mlist.ConfirmUnsubscription(cpaddr)
- # We don't also need to send a confirmation to this command
- res.respond = 0
+ try:
+ mlist.ConfirmUnsubscription(cpaddr)
+ except Errors.MMAlreadyPending:
+ res.results.append(
+ _('You already have a subscription pending confirmation'))
+ else:
+ # We don't also need to send a confirmation to this command
+ res.respond = 0
else:
# No admin approval is necessary, so we can just delete them if the
# passwords match.