summaryrefslogtreecommitdiff
path: root/Mailman/database/model/roster.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-08-05 22:49:04 -0500
committerBarry Warsaw2007-08-05 22:49:04 -0500
commit89bdaec5c735ffb2b27cc29620cb01b451b72550 (patch)
tree61c6fa40eb1d3e267475430005b50ecf44b46512 /Mailman/database/model/roster.py
parente0abca9fbdde530f7517396677c87f19c86bc0c6 (diff)
downloadmailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.gz
mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.zst
mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.zip
Fixed a problem where members of a deleted mailing list were hanging around.
This would cause duplicate members (e.g. owners) if you created, deleted and then recreated the mailing list. Mailman.app.create -> Mailman.app.lifecycle; Mailman/doc/create.txt -> Mailman/doc/lifecycle.txt; also added a remove_list() function. Added SubscriptionError base class, made HostileSubscriptionError inherit from that, and added a new AlreadySubscribedError. Rewrote bin/rmlist to use the new lifecycle.remove_list() function. IAddress.subscribe() must now throw an AlreadySubscribedError if the address is already subscribed to the mailing list with the given role. Added a Subscribers roster, attached to the IMailingList which gives access to all subscribers of a mailing list, regardless of their role. Added a new test for this roster.
Diffstat (limited to 'Mailman/database/model/roster.py')
-rw-r--r--Mailman/database/model/roster.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Mailman/database/model/roster.py b/Mailman/database/model/roster.py
index 0730d2b4b..8440e0ffc 100644
--- a/Mailman/database/model/roster.py
+++ b/Mailman/database/model/roster.py
@@ -184,3 +184,15 @@ class DigestMemberRoster(AbstractRoster):
role=MemberRole.member):
if member.delivery_mode in _digest_modes:
yield member
+
+
+
+class Subscribers(AbstractRoster):
+ """Return all subscribed members regardless of their role."""
+
+ name = 'subscribers'
+
+ @property
+ def members(self):
+ for member in Member.select_by(mailing_list=self._mlist.fqdn_listname):
+ yield member