add method to access plugin setting faster

This commit is contained in:
Matthias 2021-10-01 17:10:36 +02:00
parent 9469c17be1
commit eaffd5fd0c
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -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"""