diff options
author | bwarsaw <> | 2004-02-29 16:45:27 +0000 |
---|---|---|
committer | bwarsaw <> | 2004-02-29 16:45:27 +0000 |
commit | 21ad7e7ac75ce46bbbfc9283509cba81a42c5511 (patch) | |
tree | c2544d6628f94ca4a4abdb651c0780d8af51a70c /Mailman/Cgi | |
parent | 1e2df627a366503d62a48121a7a499761b907bcf (diff) | |
download | mailman2-21ad7e7ac75ce46bbbfc9283509cba81a42c5511.tar.gz mailman2-21ad7e7ac75ce46bbbfc9283509cba81a42c5511.tar.xz mailman2-21ad7e7ac75ce46bbbfc9283509cba81a42c5511.zip |
main(): The list lock must be held in order to pend unsubscription requests.
Diffstat (limited to 'Mailman/Cgi')
-rw-r--r-- | Mailman/Cgi/options.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py index 447dc38c..aa5b1da1 100644 --- a/Mailman/Cgi/options.py +++ b/Mailman/Cgi/options.py @@ -163,22 +163,23 @@ def main(): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): - # If unsubs require admin approval, then this request has to be - # held. Otherwise, send a confirmation. - if mlist.unsubscribe_policy: - try: - mlist.Lock() + # We must acquire the list lock in order to pend a request. + try: + mlist.Lock() + # If unsubs require admin approval, then this request has to + # be held. Otherwise, send a confirmation. + if mlist.unsubscribe_policy: mlist.HoldUnsubscription(user) doc.addError(_("""Your unsubscription request has been forwarded to the list administrator for approval."""), tag='') - mlist.Save() - finally: - mlist.Unlock() - else: - mlist.ConfirmUnsubscription(user, userlang) - doc.addError(_('The confirmation email has been sent.'), - tag='') + else: + mlist.ConfirmUnsubscription(user, userlang) + doc.addError(_('The confirmation email has been sent.'), + tag='') + mlist.Save() + finally: + mlist.Unlock() else: # Not a member if mlist.private_roster == 0: |