~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/rest/members.py

  • Committer: Barry Warsaw
  • Date: 2011-08-18 00:39:11 UTC
  • mfrom: (7036.1.4 bug-827036)
  • Revision ID: barry@list.org-20110818003911-9gef1p84g2pg4p10
 * Four new events are created, and notifications are sent during mailing list
   lifecycle changes:
   - ListCreatingEvent - sent before the mailing list is created
   - ListCreatedEvent  - sent after the mailing list is created
   - ListDeletingEvent - sent before the mailing list is deleted
   - ListDeletedEvent  - sent after the mailing list is deleted
 * Using the above events, when a mailing list is deleted, all its members are
   deleted, as well as all held message requests (but not the held messages
   themselves).  (LP: 827036)

Also: relax the find_member() argument constraints so that even the subscriber
email address is optional.  This is mirrored in the REST API's
.../members/find resource.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
    def find(self, request):
194
194
        """Find a member"""
195
195
        service = getUtility(ISubscriptionService)
196
 
        validator = Validator(fqdn_listname=unicode,
197
 
                              subscriber=unicode,
198
 
                              role=enum_validator(MemberRole),
199
 
                              _optional=('fqdn_listname', 'role'))
 
196
        validator = Validator(
 
197
            fqdn_listname=unicode,
 
198
            subscriber=unicode,
 
199
            role=enum_validator(MemberRole),
 
200
            _optional=('fqdn_listname', 'subscriber', 'role'))
200
201
        members = service.find_members(**validator(request))
201
202
        # We can't just return the _FoundMembers instance, because
202
203
        # CollectionMixins have only a GET method, which is incompatible with