Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #330 from glogiotatidis/500error
Browse files Browse the repository at this point in the history
Always display error page when errors occur.
  • Loading branch information
glogiotatidis committed Oct 29, 2012
2 parents a435533 + e89ff76 commit a84835f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/common/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ def process_response(self, request, response):
if request.user.is_authenticated():
log.debug('Permission denied middleware, user was '
'authenticated, sending 500')
return error_page(request, 500, status=response.status_code)
else:
if isinstance(response, (HttpResponseForbidden)):
log.debug('Response was forbidden')
elif isinstance(response, (HttpResponseNotAllowed)):
log.debug('Response was not allowed')
log.debug('Permission denied middleware, redirecting home')
return HttpResponseRedirect(reverse('home'))
return error_page(request, 500, status=response.status_code)
return response


Expand Down

0 comments on commit a84835f

Please sign in to comment.