From 04eee506533eaac66b5a1d727661cefd629ae546 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 3 Oct 2021 13:36:42 +0200 Subject: [PATCH] initiate plugins on startup --- InvenTree/InvenTree/settings.py | 5 +++-- InvenTree/InvenTree/urls.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 3388d7087e..dcbb4be052 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -652,14 +652,15 @@ MESSAGE_TAGS = { # Plugins PLUGIN_URL = 'plugin' -INTEGRATION_PLUGINS = inventree_plugins.load_integration_plugins() +INTEGRATION_PLUGINS = [] +for plugin in inventree_plugins.load_integration_plugins(): + INTEGRATION_PLUGINS.append(plugin()) INTEGRATION_PLUGIN_SETTINGS = {} INTEGRATION_PLUGIN_SETTING = {} INTEGRATION_PLUGIN_LIST = {} for plugin in INTEGRATION_PLUGINS: - plugin = plugin() INTEGRATION_PLUGIN_LIST[plugin.plugin_name()] = plugin if plugin.mixin_enabled('settings'): INTEGRATION_PLUGIN_SETTING[plugin.plugin_name()] = plugin.settingspatterns diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 0d75fb2938..34980b46d0 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -128,11 +128,9 @@ translated_javascript_urls = [ ] # Integration plugin urls -integration_plugins = inventree_plugins.load_integration_plugins() +integration_plugins = settings.INTEGRATION_PLUGINS interation_urls = [] for plugin in integration_plugins: - # initialize - plugin = plugin() if plugin.mixin_enabled('urls'): interation_urls.append(plugin.urlpatterns)