simplify loading

This commit is contained in:
Matthias 2021-10-03 14:16:21 +02:00
parent cd343d224b
commit 8fc2610a9d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -659,15 +659,19 @@ MESSAGE_TAGS = {
PLUGIN_URL = 'plugin'
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:
INTEGRATION_PLUGIN_LIST[plugin.plugin_name()] = plugin
for plugin in inventree_plugins.load_integration_plugins():
plugin = plugin()
plugin_name = plugin.plugin_name()
INTEGRATION_PLUGINS.append(plugin)
INTEGRATION_PLUGIN_LIST[plugin_name] = plugin
if plugin.mixin_enabled('settings'):
INTEGRATION_PLUGIN_SETTING[plugin.plugin_name()] = plugin.settingspatterns
INTEGRATION_PLUGIN_SETTINGS.update(plugin.settingspatterns)
plugin_setting = plugin.settingspatterns
INTEGRATION_PLUGIN_SETTING[plugin_name] = plugin_setting
INTEGRATION_PLUGIN_SETTINGS.update(plugin_setting)