mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix import order
This commit is contained in:
parent
329f336b57
commit
b01d54b586
@ -8,10 +8,8 @@ from django.urls import include, re_path
|
||||
|
||||
import requests
|
||||
|
||||
import InvenTree.helpers
|
||||
from plugin.helpers import (MixinImplementationError, MixinNotImplementedError,
|
||||
render_template, render_text)
|
||||
from plugin.models import PluginConfig, PluginSetting
|
||||
from plugin.urls import PLUGIN_BASE
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
@ -42,10 +40,14 @@ class SettingsMixin:
|
||||
key: The 'name' of the setting value to be retrieved
|
||||
cache: Whether to use RAM cached value (default = False)
|
||||
"""
|
||||
from plugin.models import PluginSetting
|
||||
|
||||
return PluginSetting.get_setting(key, plugin=self, cache=cache)
|
||||
|
||||
def set_setting(self, key, value, user=None):
|
||||
"""Set plugin setting value by key."""
|
||||
from plugin.models import PluginConfig, PluginSetting
|
||||
|
||||
try:
|
||||
plugin, _ = PluginConfig.objects.get_or_create(key=self.plugin_slug(), name=self.plugin_name())
|
||||
except (OperationalError, ProgrammingError): # pragma: no cover
|
||||
@ -698,6 +700,8 @@ class PanelMixin:
|
||||
Returns:
|
||||
Array of panels
|
||||
"""
|
||||
import InvenTree.helpers
|
||||
|
||||
panels = []
|
||||
|
||||
# Construct an updated context object for template rendering
|
||||
|
@ -36,8 +36,9 @@ logger = logging.getLogger('inventree')
|
||||
class PluginsRegistry:
|
||||
"""The PluginsRegistry class."""
|
||||
|
||||
from . import mixins
|
||||
DEFAULT_MIXIN_ORDER = [mixins.SettingsMixin, mixins.ScheduleMixin, mixins.AppMixin, mixins.UrlsMixin]
|
||||
from .base.integration.mixins import (AppMixin, ScheduleMixin,
|
||||
SettingsMixin, UrlsMixin)
|
||||
DEFAULT_MIXIN_ORDER = [SettingsMixin, ScheduleMixin, AppMixin, UrlsMixin]
|
||||
|
||||
def __init__(self, mixin_order: list = None) -> None:
|
||||
"""Initialize registry.
|
||||
|
Loading…
Reference in New Issue
Block a user