mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #3408: Remove WEBHOOKS_ENABLE configuration setting
This commit is contained in:
@@ -11,6 +11,7 @@ class NetBoxAdminSite(AdminSite):
|
||||
site_header = 'NetBox Administration'
|
||||
site_title = 'NetBox'
|
||||
site_url = '/{}'.format(settings.BASE_PATH)
|
||||
index_template = 'django_rq/index.html'
|
||||
|
||||
|
||||
admin_site = NetBoxAdminSite(name='admin')
|
||||
@@ -18,11 +19,3 @@ admin_site = NetBoxAdminSite(name='admin')
|
||||
# Register external models
|
||||
admin_site.register(Group, GroupAdmin)
|
||||
admin_site.register(User, UserAdmin)
|
||||
|
||||
# Modify the template to include an RQ link if django_rq is installed (see RQ_SHOW_ADMIN_LINK)
|
||||
if settings.WEBHOOKS_ENABLED:
|
||||
try:
|
||||
import django_rq
|
||||
admin_site.index_template = 'django_rq/index.html'
|
||||
except ImportError:
|
||||
pass
|
||||
|
@@ -178,10 +178,6 @@ SESSION_FILE_PATH = None
|
||||
# Time zone (default: UTC)
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
# The webhooks backend is disabled by default. Set this to True to enable it. Note that this requires a Redis
|
||||
# database be configured and accessible by NetBox.
|
||||
WEBHOOKS_ENABLED = False
|
||||
|
||||
# Date/time formatting. See the following link for supported formats:
|
||||
# https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'N j, Y'
|
||||
|
@@ -92,7 +92,6 @@ SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H
|
||||
SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s')
|
||||
TIME_FORMAT = getattr(configuration, 'TIME_FORMAT', 'g:i a')
|
||||
TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC')
|
||||
WEBHOOKS_ENABLED = getattr(configuration, 'WEBHOOKS_ENABLED', False)
|
||||
|
||||
|
||||
#
|
||||
@@ -184,6 +183,7 @@ INSTALLED_APPS = [
|
||||
'corsheaders',
|
||||
'debug_toolbar',
|
||||
'django_filters',
|
||||
'django_rq',
|
||||
'django_tables2',
|
||||
'django_prometheus',
|
||||
'mptt',
|
||||
@@ -203,10 +203,6 @@ INSTALLED_APPS = [
|
||||
'drf_yasg',
|
||||
]
|
||||
|
||||
# Only load django-rq if the webhook backend is enabled
|
||||
if WEBHOOKS_ENABLED:
|
||||
INSTALLED_APPS.append('django_rq')
|
||||
|
||||
# Middleware
|
||||
MIDDLEWARE = (
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
|
@@ -59,14 +59,10 @@ _patterns = [
|
||||
|
||||
# Admin
|
||||
path(r'admin/', admin_site.urls),
|
||||
path(r'admin/webhook-backend-status/', include('django_rq.urls')),
|
||||
|
||||
]
|
||||
|
||||
if settings.WEBHOOKS_ENABLED:
|
||||
_patterns += [
|
||||
path(r'admin/webhook-backend-status/', include('django_rq.urls')),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
import debug_toolbar
|
||||
_patterns += [
|
||||
|
Reference in New Issue
Block a user