Give the 4xx error handler views the correct positional arguments

This commit is contained in:
Jeff Bradberry 2019-07-09 13:44:55 -04:00
parent 6737bd4c19
commit 2ffe3d9a85
2 changed files with 3 additions and 4 deletions

View File

@ -11,7 +11,6 @@ from jinja2 import Environment, StrictUndefined
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
# Django
import django
from django.contrib.postgres.fields import JSONField as upstream_JSONBField
from django.core import exceptions as django_exceptions
from django.core.serializers.json import DjangoJSONEncoder

View File

@ -60,7 +60,7 @@ def handle_error(request, status=404, **kwargs):
return render(request, 'error.html', kwargs, status=status)
def handle_400(request):
def handle_400(request, exception):
kwargs = {
'name': _('Bad Request'),
'content': _('The request could not be understood by the server.'),
@ -68,7 +68,7 @@ def handle_400(request):
return handle_error(request, 400, **kwargs)
def handle_403(request):
def handle_403(request, exception):
kwargs = {
'name': _('Forbidden'),
'content': _('You don\'t have permission to access the requested resource.'),
@ -76,7 +76,7 @@ def handle_403(request):
return handle_error(request, 403, **kwargs)
def handle_404(request):
def handle_404(request, exception):
kwargs = {
'name': _('Not Found'),
'content': _('The requested resource could not be found.'),