mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
load django internal reloading mechanisms
This commit is contained in:
parent
f13507e23c
commit
9ecf9603d6
@ -866,6 +866,7 @@ INTEGRATION_PLUGINS_INACTIVE = {}
|
||||
INTEGRATION_PLUGIN_GLOBALSETTING = {}
|
||||
|
||||
INTEGRATION_APPS_LOADED = False # Marks if apps were reloaded yet
|
||||
INTEGRATION_PLUGINS_RELOADING = False
|
||||
INTEGRATION_APPS_PATHS = [] # Holds all added plugin_paths
|
||||
|
||||
# Test settings
|
||||
|
@ -26,8 +26,9 @@ class PluginAppConfig(AppConfig):
|
||||
name = 'plugin'
|
||||
|
||||
def ready(self):
|
||||
self._collect_plugins()
|
||||
self.load_plugins()
|
||||
if not settings.INTEGRATION_PLUGINS_RELOADING:
|
||||
self._collect_plugins()
|
||||
self.load_plugins()
|
||||
|
||||
# region public plugin functions
|
||||
def load_plugins(self):
|
||||
@ -224,10 +225,8 @@ class PluginAppConfig(AppConfig):
|
||||
print('done')
|
||||
|
||||
def _reload_apps(self):
|
||||
# TODO this is a bit jankey to be honest
|
||||
apps.app_configs = OrderedDict()
|
||||
apps.apps_ready = apps.models_ready = apps.loading = apps.ready = False
|
||||
apps.clear_cache()
|
||||
apps.populate(settings.INSTALLED_APPS)
|
||||
settings.INTEGRATION_PLUGINS_RELOADING = True
|
||||
apps.set_installed_apps(settings.INSTALLED_APPS)
|
||||
settings.INTEGRATION_PLUGINS_RELOADING = False
|
||||
# endregion
|
||||
# endregion
|
||||
|
Loading…
Reference in New Issue
Block a user