diff options
Diffstat (limited to 'src/mailman/rest/publication.py')
| -rw-r--r-- | src/mailman/rest/publication.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/rest/publication.py b/src/mailman/rest/publication.py index 1b0e1ee00..2de9c8120 100644 --- a/src/mailman/rest/publication.py +++ b/src/mailman/rest/publication.py @@ -85,11 +85,21 @@ class Publication: """See `IPublication`.""" # Any in-progress transaction must be aborted. config.db.abort() + # Reproduce the behavior of ZopePublication by looking up a view + # for this exception. exception = exc_info[1] + # 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. if isinstance(exception, NotFound): request.response.reset() request.response.setStatus(404) request.response.setResult('') + return + view = queryMultiAdapter((exception, request), name='index.html') + if view is not None: + exc_info = None + request.response.reset() + request.response.setResult(view()) else: traceback.print_exception(*exc_info) |
