Broken REST API to get member from list given email address (and role).
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Medium
|
Barry Warsaw |
Bug Description
There is code in src/mailman/
the last line of the member function in lists.py:
return AMember(
compare to AMember constructor:
def __init__(self, member_id):
Attempting to use this part of the API returns a 500 with this traceback:
Traceback (most recent call last):
File "/usr/lib64/
self.result = application(
File "/home/
environ, start_response)
File "/home/
resource_
File "/home/
result = resource_
File "/home/
result = func(self, request, segments, *match_args, **match_kwargs)
File "/home/
return AMember(
TypeError: __init__() takes exactly 2 arguments (4 given)
Changed in mailman: | |
status: | New → Confirmed |
milestone: | none → 3.0.0a8 |
assignee: | nobody → Barry Warsaw (barry) |
importance: | Undecided → Medium |
Changed in mailman: | |
status: | Fix Committed → Fix Released |
The attached patch fixes this issue, but ignores the "role" aspect, so it just looks for a member with that address in that list.
This gives the following endpoint:
/3.0/lists/ <listname> /member/ <email>
This fits my use case, otherwise I would have to get a list of all members of a list to find the one with a given email address.