mirror of
https://github.com/ansible/awx.git
synced 2026-03-17 00:47:29 -02:30
AC-996 Don't try to use admin template since admin is disabled.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
|
from django.conf import settings
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
@@ -10,7 +11,7 @@ def handle_error(request, status=404, **kwargs):
|
|||||||
# FIXME: Should attempt to check HTTP Accept request header and return
|
# FIXME: Should attempt to check HTTP Accept request header and return
|
||||||
# plain JSON response instead of HTML (maybe only for /api/*).
|
# plain JSON response instead of HTML (maybe only for /api/*).
|
||||||
context = kwargs
|
context = kwargs
|
||||||
if request.path.startswith('/admin/'):
|
if 'django.contrib.admin' in settings.INSTALLED_APPS and request.path.startswith('/admin/'):
|
||||||
template_name = 'admin/error.html'
|
template_name = 'admin/error.html'
|
||||||
else:
|
else:
|
||||||
# Return enough context to popuplate the base API template.
|
# Return enough context to popuplate the base API template.
|
||||||
|
|||||||
Reference in New Issue
Block a user