From 2bcf21ce4ca552bf11d38ed753d33e76975d5ecf Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 17 Aug 2009 17:02:02 -0400 Subject: Use an adapter instead of custom handleException() code to return a 404 instead of a 500 for NotFound errors. --- src/mailman/rest/configure.zcml | 8 ++++++++ src/mailman/rest/publication.py | 12 ++---------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mailman/rest/configure.zcml b/src/mailman/rest/configure.zcml index 83ad4ff00..95bcfd194 100644 --- a/src/mailman/rest/configure.zcml +++ b/src/mailman/rest/configure.zcml @@ -41,6 +41,14 @@ factory="mailman.rest.urls.MailingListURLMapper" /> + + diff --git a/src/mailman/rest/publication.py b/src/mailman/rest/publication.py index 7c121a1c3..1918dcbc0 100644 --- a/src/mailman/rest/publication.py +++ b/src/mailman/rest/publication.py @@ -56,16 +56,8 @@ class AdminWebServicePublication(Publication): """See `IPublication`.""" # Any in-progress transaction must be aborted. config.db.abort() - # XXX BAW 2009-08-06 This should not be necessary. I need to register - # a view so that 404 will be returned for a NotFound. - exception = exc_info[1] - if isinstance(exception, NotFound): - request.response.reset() - request.response.setStatus(404) - request.response.setResult('') - else: - super(AdminWebServicePublication, self).handleException( - application, request, exc_info, retry_allowed) + super(AdminWebServicePublication, self).handleException( + application, request, exc_info, retry_allowed) def endRequest(self, request, ob): """Ends the interaction.""" -- cgit v1.2.3-70-g09d2