From df6ec9f2960f1de89acc17ec28c3fe170a32e1dd Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 30 Jan 2012 10:37:16 -0500 Subject: * Held messages can now be moderated through the REST API. Mailing list resources now accept a `held` path component. GETing this returns all held messages for the mailing list. POSTing to a specific request id under this url can dispose of the message using `Action` enums. * `IRequests` interface is removed. Now just use adaptation from `IListRequests` directly (which takes an `IMailingList` object). * `handle_message()` now allows for `Action.hold` which is synonymous with `Action.defer` (since the message is already being held). * `IListRequests.get_request()` now takes an optional `request_type` argument to narrow the search for the given request. - also, print_function is now a standard __future__ import. The template has been updated, but add this to modules as you edit them. --- src/mailman/interfaces/requests.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/mailman/interfaces/requests.py') diff --git a/src/mailman/interfaces/requests.py b/src/mailman/interfaces/requests.py index 55fb6395c..6e3162274 100644 --- a/src/mailman/interfaces/requests.py +++ b/src/mailman/interfaces/requests.py @@ -26,7 +26,6 @@ from __future__ import absolute_import, unicode_literals __metaclass__ = type __all__ = [ 'IListRequests', - 'IRequests', 'RequestType', ] @@ -87,10 +86,14 @@ class IListRequests(Interface): Only items with a matching `type' are returned. """ - def get_request(request_id): + def get_request(request_id, request_type): """Get the data associated with the request id, or None. :param request_id: The unique id for the request. + :type request_id: int + :param request_type: Optional request type that the requested id must + match, otherwise no match is returned. + :type request_type: `RequestType` :return: A 2-tuple of the key and data originally held, or None if the `request_id` is not in the database. """ @@ -101,15 +104,3 @@ class IListRequests(Interface): :param request_id: The unique id for the request. :raises KeyError: If `request_id` is not in the database. """ - - - -class IRequests(Interface): - """The requests database.""" - - def get_list_requests(mailing_list): - """Return the `IListRequests` object for the given mailing list. - - :param mailing_list: An `IMailingList`. - :return: An `IListRequests` object for the mailing list. - """ -- cgit v1.2.3-70-g09d2