From 3db11b8bcb7194b5672426ad057f965734134a59 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 16 Apr 2011 12:55:48 -0400 Subject: Refactor .subscribe() from IAddress to IMailingList. --- src/mailman/interfaces/mailinglist.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/mailman/interfaces/mailinglist.py') diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py index d8c0ebb26..32f21a792 100644 --- a/src/mailman/interfaces/mailinglist.py +++ b/src/mailman/interfaces/mailinglist.py @@ -182,7 +182,7 @@ class IMailingList(Interface): def confirm_address(cookie=''): """The address used for various forms of email confirmation.""" - # Rosters. + # Rosters and subscriptions. owners = Attribute( """The IUser owners of this mailing list. @@ -232,6 +232,20 @@ class IMailingList(Interface): :rtype: Roster """ + def subscribe(address, role): + """Subscribe the given address to the mailing list. + + :param address: The address to subscribe. + :type address: `IAddress` + :param role: The role being subscribed to (e.g. a member, owner, or + moderator of a mailing list. + :type role: `MemberRole` + :return: The member object representing the subscription. + :rtype: `IMember` + :raises AlreadySubscribedError: If the address is already subscribed + to the mailing list with the given role. + """ + # Posting history. last_post_at = Attribute( -- cgit v1.2.3-70-g09d2