mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 02:17:37 -02:30
Give the 4xx error handler views the correct positional arguments
This commit is contained in:
@@ -11,7 +11,6 @@ from jinja2 import Environment, StrictUndefined
|
|||||||
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
|
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
import django
|
|
||||||
from django.contrib.postgres.fields import JSONField as upstream_JSONBField
|
from django.contrib.postgres.fields import JSONField as upstream_JSONBField
|
||||||
from django.core import exceptions as django_exceptions
|
from django.core import exceptions as django_exceptions
|
||||||
from django.core.serializers.json import DjangoJSONEncoder
|
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)
|
return render(request, 'error.html', kwargs, status=status)
|
||||||
|
|
||||||
|
|
||||||
def handle_400(request):
|
def handle_400(request, exception):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'name': _('Bad Request'),
|
'name': _('Bad Request'),
|
||||||
'content': _('The request could not be understood by the server.'),
|
'content': _('The request could not be understood by the server.'),
|
||||||
@@ -68,7 +68,7 @@ def handle_400(request):
|
|||||||
return handle_error(request, 400, **kwargs)
|
return handle_error(request, 400, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def handle_403(request):
|
def handle_403(request, exception):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'name': _('Forbidden'),
|
'name': _('Forbidden'),
|
||||||
'content': _('You don\'t have permission to access the requested resource.'),
|
'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)
|
return handle_error(request, 403, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def handle_404(request):
|
def handle_404(request, exception):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'name': _('Not Found'),
|
'name': _('Not Found'),
|
||||||
'content': _('The requested resource could not be found.'),
|
'content': _('The requested resource could not be found.'),
|
||||||
|
|||||||
Reference in New Issue
Block a user