Send appropriate error codes back with error pages

This commit is contained in:
Mouse Reeve 2020-12-30 11:42:07 -08:00
parent 490591623f
commit d3161ea361

View file

@ -38,12 +38,14 @@ def is_api_request(request):
def server_error_page(request):
''' 500 errors '''
return TemplateResponse(request, 'error.html', {'title': 'Oops!'})
return TemplateResponse(
request, 'error.html', {'title': 'Oops!'}, status=500)
def not_found_page(request, _):
''' 404s '''
return TemplateResponse(request, 'notfound.html', {'title': 'Not found'})
return TemplateResponse(
request, 'notfound.html', {'title': 'Not found'}, status=404)
@login_required