Skip to content

Commit

Permalink
call exception view before triggering _unaothorized, as proposed by l…
Browse files Browse the repository at this point in the history
  • Loading branch information
tschorr committed Jul 20, 2018
1 parent 77ca45c commit 5263ce0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ZPublisher/WSGIPublisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ def transaction_pubevents(request, response, tm=transaction.manager):
if request.environ.get('x-wsgiorg.throw_errors', False):
reraise(*exc_info)

# Handle exception view
exc_view_created = _exc_view_created_response(
exc, request, response)

if isinstance(exc, Unauthorized):
# _unauthorized modifies the response in-place. If this hook
# is used, an exception view for Unauthorized has to merge
Expand All @@ -157,10 +161,6 @@ def transaction_pubevents(request, response, tm=transaction.manager):
response._unauthorized()
response.setStatus(exc.getStatus())

# Handle exception view
exc_view_created = _exc_view_created_response(
exc, request, response)

notify(pubevents.PubBeforeAbort(
request, exc_info, request.supports_retry()))
tm.abort()
Expand Down

0 comments on commit 5263ce0

Please sign in to comment.