remove unneeded settings

This commit is contained in:
Matthias 2021-10-17 04:35:24 +02:00
parent cad744e40b
commit 48abd3cf79
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 2 additions and 6 deletions

View File

@ -753,13 +753,10 @@ for plugin in PLUGIN_DIRS:
[PLUGINS.append(item) for item in modules] [PLUGINS.append(item) for item in modules]
# collect integration plugins # collect integration plugins
INTEGRATION_PLUGINS = []
INTEGRATION_PLUGIN_SETTING = {} INTEGRATION_PLUGIN_SETTING = {}
INTEGRATION_PLUGIN_LIST = {} INTEGRATION_PLUGIN_LIST = {}
INTEGRATION_APPS_LOADED = False # Marks if apps were reloaded yet INTEGRATION_APPS_LOADED = False # Marks if apps were reloaded yet
for plugin in inventree_plugins.load_integration_plugins(): for plugin in inventree_plugins.load_integration_plugins():
plugin = plugin() plugin = plugin()
INTEGRATION_PLUGINS.append(plugin)
INTEGRATION_PLUGIN_LIST[plugin.slug] = plugin INTEGRATION_PLUGIN_LIST[plugin.slug] = plugin

View File

@ -128,8 +128,7 @@ translated_javascript_urls = [
# Integration plugin urls # Integration plugin urls
interation_urls = [] interation_urls = []
if InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'): if InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'):
integration_plugins = settings.INTEGRATION_PLUGINS for plugin in settings.INTEGRATION_PLUGIN_LIST.values():
for plugin in integration_plugins:
if plugin.mixin_enabled('urls'): if plugin.mixin_enabled('urls'):
interation_urls.append(plugin.urlpatterns) interation_urls.append(plugin.urlpatterns)

View File

@ -12,7 +12,7 @@ class PluginTemplateLoader(FilesystemLoader):
def get_dirs(self): def get_dirs(self):
dirname = 'templates' dirname = 'templates'
template_dirs = [] template_dirs = []
for plugin in settings.INTEGRATION_PLUGINS: for plugin in settings.INTEGRATION_PLUGIN_LIST.values():
new_path = Path(plugin.path) / dirname new_path = Path(plugin.path) / dirname
if Path(new_path).is_dir(): if Path(new_path).is_dir():
template_dirs.append(new_path) template_dirs.append(new_path)