1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Drop caching_config from plugin configuration

This commit is contained in:
jeremystretch
2021-07-07 17:04:21 -04:00
parent 9c247d9a19
commit f683f0786e
5 changed files with 3 additions and 50 deletions

View File

@@ -47,11 +47,6 @@ class PluginConfig(AppConfig):
# Middleware classes provided by the plugin
middleware = []
# Cacheops configuration. Cache all operations by default.
caching_config = {
'*': {'ops': 'all'},
}
# Default integration paths. Plugin authors can override these to customize the paths to
# integrated components.
template_extensions = 'template_content.template_extensions'

View File

@@ -80,12 +80,6 @@ class PluginTest(TestCase):
"""
self.assertIn('extras.tests.dummy_plugin.middleware.DummyMiddleware', settings.MIDDLEWARE)
def test_caching_config(self):
"""
Check that plugin caching configuration is registered.
"""
self.assertIn('extras.tests.dummy_plugin.*', settings.CACHEOPS)
def test_min_version(self):
"""
Check enforcement of minimum NetBox version.

View File

@@ -632,12 +632,3 @@ for plugin_name in PLUGINS:
plugin_middleware = plugin_config.middleware
if plugin_middleware and type(plugin_middleware) in (list, tuple):
MIDDLEWARE.extend(plugin_middleware)
# Apply cacheops config
if type(plugin_config.caching_config) is not dict:
raise ImproperlyConfigured(
"Plugin {} caching_config must be a dictionary.".format(plugin_name)
)
CACHEOPS.update({
"{}.{}".format(plugin_name, key): value for key, value in plugin_config.caching_config.items()
})