summaryrefslogtreecommitdiff
path: root/src/mailman/commands
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-01 15:07:43 -0500
committerBarry Warsaw2012-03-01 15:07:43 -0500
commitde572e747fb46f1c942dbe0dc37fb9fd7f8ae01a (patch)
tree7bb8b06a32d3b713323baad4309bca50f791cd25 /src/mailman/commands
parent3559021627038314f5bf22d3515738d99d0f8805 (diff)
downloadmailman-de572e747fb46f1c942dbe0dc37fb9fd7f8ae01a.tar.gz
mailman-de572e747fb46f1c942dbe0dc37fb9fd7f8ae01a.tar.zst
mailman-de572e747fb46f1c942dbe0dc37fb9fd7f8ae01a.zip
Prevent the `confirm` command from running more than once on the same token.
Also add some debugging to the verification message, IOW, which template is it using (this may be more generally useful, but for now, it's an experiment).
Diffstat (limited to 'src/mailman/commands')
-rw-r--r--src/mailman/commands/eml_confirm.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mailman/commands/eml_confirm.py b/src/mailman/commands/eml_confirm.py
index 97bb80f06..2461192ed 100644
--- a/src/mailman/commands/eml_confirm.py
+++ b/src/mailman/commands/eml_confirm.py
@@ -49,7 +49,15 @@ class Confirm:
if len(arguments) == 0:
print >> results, _('No confirmation token found')
return ContinueProcessing.no
- succeeded = getUtility(IRegistrar).confirm(arguments[0])
+ # Make sure we don't try to confirm the same token more than once.
+ token = arguments[0]
+ tokens = getattr(results, 'confirms', set())
+ if token in tokens:
+ # Do not try to confirm this one again.
+ return ContinueProcessing.yes
+ tokens.add(token)
+ results.confirms = tokens
+ succeeded = getUtility(IRegistrar).confirm(token)
if succeeded:
print >> results, _('Confirmed')
return ContinueProcessing.yes