Merge pull request #22773 from edx/usama/bom-1137

Updated ExceptionViews handles
This commit is contained in:
Usama Sadiq
2020-01-10 16:29:19 +05:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ def jsonable_error(status=500, message="The Studio servers encountered an error"
@jsonable_error(404, "Resource not found")
def not_found(request):
def not_found(request, exception):
return render_to_response('error.html', {'error': '404'})
@@ -42,7 +42,7 @@ def server_error(request):
@fix_crum_request
@jsonable_error(404, "Resource not found")
def render_404(request):
def render_404(request, exception):
return HttpResponseNotFound(render_to_string('404.html', {}, request=request))

View File

@@ -1,3 +1,5 @@
# pylint: disable=missing-docstring,unused-argument
# View for semi-static templatized content.
#
# List of valid templates is explicitly managed for (short-term)
@@ -91,7 +93,7 @@ def render_press_release(request, slug):
@fix_crum_request
def render_404(request):
def render_404(request, exception):
return HttpResponseNotFound(render_to_string('static_templates/404.html', {}, request=request))