Fix error views so they return the correct HTTP status

This commit is contained in:
Gergely Polonkai 2014-06-16 14:09:42 +02:00
parent 06fb6b3a09
commit f98017e70e

View File

@ -15,13 +15,17 @@ def disclaimer(request):
return render(request, 'basics/disclaimer.html', {}) return render(request, 'basics/disclaimer.html', {})
def notfound(request): def notfound(request):
return render(request, 'basics/notfound.html', {}) body = render_to_string('basics/notfound.html', {})
return HttpResponse(body, status_code = 404)
def serverror(request): def serverror(request):
return render(request, 'basics/serverror.html', {}) body = render_to_string('basics/serverror.html', {})
return HttpResponse(body, status_code = 500)
def forbidden(request): def forbidden(request):
return render(request, 'basics/forbidden.html', {}) body = render_to_string('basics/forbidden.html', {})
return HttpResponse(body, status_code = 403)
def badrequest(request): def badrequest(request):
return render(request, 'basics/badrequest.html', {}) body = render_to_string('basics/badrequest.html', {})
return HttpResponse(body, status_code = 400)