From eaffd5fd0c8d4b3b6e5309444dea7593b0860a46 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 1 Oct 2021 17:10:36 +0200 Subject: [PATCH] add method to access plugin setting faster --- InvenTree/plugins/integration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/InvenTree/plugins/integration.py b/InvenTree/plugins/integration.py index 69ec3d22a3..5e926e7ff1 100644 --- a/InvenTree/plugins/integration.py +++ b/InvenTree/plugins/integration.py @@ -85,6 +85,13 @@ class SettingsMixin: return {f'PLUGIN_{self.plugin_name().upper()}_{key}': value for key, value in self.settings.items()} return None + def get_setting(self, key): + """ + get plugin setting by key + """ + from common.models import InvenTreeSetting + return InvenTreeSetting.get_setting(f'PLUGIN_{self.PLUGIN_NAME.upper()}_{key}') + class UrlsMixin: """Mixin that enables urls for the plugin"""