aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Commands
diff options
context:
space:
mode:
authorbwarsaw <>2003-11-19 23:01:24 +0000
committerbwarsaw <>2003-11-19 23:01:24 +0000
commitf4393275d00ecebdce633ca9de1c3a3933e0a223 (patch)
tree07ed6ee9bd774ff9675ec02bc3d8fcaefe0b6579 /Mailman/Commands
parentf1a28f4cb4d15df1a46894640e9b88f22f1e7205 (diff)
downloadmailman2-f4393275d00ecebdce633ca9de1c3a3933e0a223.tar.gz
mailman2-f4393275d00ecebdce633ca9de1c3a3933e0a223.tar.xz
mailman2-f4393275d00ecebdce633ca9de1c3a3933e0a223.zip
set_delivery(): Fixed the email command 'set delivery [on|off]' which
was trying to use the setMemberOption() interface. This doesn't work for delivery settings -- it needed to use the setDeliveryStatus() interface.
Diffstat (limited to 'Mailman/Commands')
-rw-r--r--Mailman/Commands/cmd_set.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/Mailman/Commands/cmd_set.py b/Mailman/Commands/cmd_set.py
index c3eaa9a6..8f692613 100644
--- a/Mailman/Commands/cmd_set.py
+++ b/Mailman/Commands/cmd_set.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2003 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -292,10 +292,16 @@ class SetCommands:
status = self._status(res, args[0])
if status < 0:
return STOP
- # sense is reversed
- mlist.setMemberOption(self.__address, mm_cfg.DisableDelivery,
- not status)
- res.results.append(_('delivery option set'))
+ # Delivery status is handled differently than other options. If
+ # status is true (set delivery on), then we enable delivery.
+ # Otherwise, we have to use the setDeliveryStatus() interface to
+ # specify that delivery was disabled by the user.
+ if status:
+ mlist.setDeliveryStatus(self.__address, MemberAdaptor.ENABLED)
+ res.results.append(_('delivery enabled'))
+ else:
+ mlist.setDeliveryStatus(self.__address, MemberAdaptor.BYUSER)
+ res.results.append(_('delivery disabled by user'))
def set_myposts(self, res, args):
mlist = res.mlist
@@ -308,7 +314,7 @@ class SetCommands:
mlist.setMemberOption(self.__address, mm_cfg.DontReceiveOwnPosts,
not status)
res.results.append(_('myposts option set'))
-
+
def set_hide(self, res, args):
mlist = res.mlist
if len(args) <> 1:
@@ -343,7 +349,7 @@ class SetCommands:
mlist.setMemberOption(self.__address, mm_cfg.SuppressPasswordReminder,
not status)
res.results.append(_('reminder option set'))
-
+
def process(res, args):