From e6841ce42f4df2ee2fecc659adffbede2005afb9 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 31 May 2001 16:03:41 +0000 Subject: Added another confirmable action: a change of address request. Specifically, CHANGE_OF_ADDRESS: new constant for this type of confirmable request. new(): Add CHANGE_OF_ADDRESS to the assert. --- Mailman/Pending.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Mailman/Pending.py b/Mailman/Pending.py index 44b7c94e7..f196fd505 100644 --- a/Mailman/Pending.py +++ b/Mailman/Pending.py @@ -38,13 +38,18 @@ LOCKFILE = os.path.join(mm_cfg.LOCK_DIR, 'pending.lock') # Types of pending records SUBSCRIPTION = 'S' UNSUBSCRIPTION = 'U' +CHANGE_OF_ADDRESS = 'C' def new(*content): """Create a new entry in the pending database, returning cookie for it.""" - # It's a programming error if this assertion fails! - assert content[:1] in ((SUBSCRIPTION,), (UNSUBSCRIPTION,)) + # It's a programming error if this assertion fails! We do it this way so + # the assert test won't fail if the sequence is empty. + assert content[:1] in ((SUBSCRIPTION,), + (UNSUBSCRIPTION,), + (CHANGE_OF_ADDRESS,), + ) # Acquire the pending database lock, letting TimeOutError percolate up. lock = LockFile.LockFile(LOCKFILE) lock.lock(timeout=30) -- cgit v1.2.3-70-g09d2