mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-02 08:30:45 +00:00
Implement new approach for plugin settings
- URL specifies plugin slug and setting key
This commit is contained in:
1 parent
f733e23b65
commit
3a9bacb27c
7 files changed
+91
-24
No files matched your search
@@ -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