Fix error views so they return the correct HTTP status
This commit is contained in:
parent
06fb6b3a09
commit
f98017e70e
@ -15,13 +15,17 @@ def disclaimer(request):
|
||||
return render(request, 'basics/disclaimer.html', {})
|
||||
|
||||
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):
|
||||
return render(request, 'basics/serverror.html', {})
|
||||
body = render_to_string('basics/serverror.html', {})
|
||||
return HttpResponse(body, status_code = 500)
|
||||
|
||||
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):
|
||||
return render(request, 'basics/badrequest.html', {})
|
||||
body = render_to_string('basics/badrequest.html', {})
|
||||
return HttpResponse(body, status_code = 400)
|
||||
|
Loading…
Reference in New Issue
Block a user