mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 12:42:52 -06:00
added support for prepending elements to middleware
This commit is contained in:
parent
981c982237
commit
2f37357a1b
@ -298,6 +298,7 @@ TEMPLATES = [
|
|||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'utilities.context_processors.settings',
|
'utilities.context_processors.settings',
|
||||||
|
'extras.plugins.context_processors.nav_menu_links',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -629,6 +630,9 @@ if PLUGINS_ENABLED:
|
|||||||
plugin_middleware = getattr(app_config_meta, 'middleware', [])
|
plugin_middleware = getattr(app_config_meta, 'middleware', [])
|
||||||
if plugin_middleware and isinstance(plugin_middleware, list):
|
if plugin_middleware and isinstance(plugin_middleware, list):
|
||||||
MIDDLEWARE.extend(plugin_middleware)
|
MIDDLEWARE.extend(plugin_middleware)
|
||||||
|
plugin_middleware_prepend = getattr(app_config_meta, 'middleware_prepend', [])
|
||||||
|
if plugin_middleware_prepend and isinstance(plugin_middleware_prepend, list):
|
||||||
|
MIDDLEWARE[:0] = plugin_middleware_prepend
|
||||||
|
|
||||||
# Add installed apps
|
# Add installed apps
|
||||||
plugin_installed_apps = getattr(app_config_meta, 'installed_apps', [])
|
plugin_installed_apps = getattr(app_config_meta, 'installed_apps', [])
|
||||||
|
Loading…
Reference in New Issue
Block a user