mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-05 19:41:41 +00:00
Implement new approach for plugin settings
- URL specifies plugin slug and setting key
This commit is contained in:
@@ -71,16 +71,15 @@ class LabelPrintMixin:
|
||||
|
||||
plugin_key = request.query_params.get('plugin', None)
|
||||
|
||||
for slug, plugin in registry.plugins.items():
|
||||
plugin = registry.get_plugin(plugin_key)
|
||||
|
||||
if slug == plugin_key and plugin.mixin_enabled('labels'):
|
||||
|
||||
config = plugin.plugin_config()
|
||||
|
||||
if config and config.active:
|
||||
# Only return the plugin if it is enabled!
|
||||
return plugin
|
||||
if plugin:
|
||||
config = plugin.plugin_config()
|
||||
|
||||
if config and config.active:
|
||||
# Only return the plugin if it is enabled!
|
||||
return plugin
|
||||
|
||||
# No matches found
|
||||
return None
|
||||
|
||||
|
Reference in New Issue
Block a user