mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 14:38:00 -03:30
Give the 4xx error handler views the correct positional arguments
This commit is contained in:
parent
6737bd4c19
commit
2ffe3d9a85
@ -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
|
||||
|
||||
@ -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.'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user