From 2ffe3d9a854b7b1c5b25231927ec2b05fb3b1aab Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Tue, 9 Jul 2019 13:44:55 -0400 Subject: [PATCH] Give the 4xx error handler views the correct positional arguments --- awx/main/fields.py | 1 - awx/main/views.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/awx/main/fields.py b/awx/main/fields.py index 44ea4305af..110492b173 100644 --- a/awx/main/fields.py +++ b/awx/main/fields.py @@ -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 diff --git a/awx/main/views.py b/awx/main/views.py index 13230d0846..1947bd001c 100644 --- a/awx/main/views.py +++ b/awx/main/views.py @@ -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.'),