From ad98c1df483fb4647fc77278074f930ab3320852 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 20 Nov 2021 03:03:57 +0100 Subject: [PATCH] refactor registry cleaning --- InvenTree/plugin/apps.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index 14f077847b..cd16de5291 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -68,10 +68,7 @@ class PluginAppConfig(AppConfig): set_maintenance_mode(True) # remove all plugins from registry - # plugins = settings.INTEGRATION_PLUGINS - settings.INTEGRATION_PLUGINS = {} - # plugins_inactive = settings.INTEGRATION_PLUGINS_INACTIVE - settings.INTEGRATION_PLUGINS_INACTIVE = {} + self._clean_registry() # deactivate all integrations self._deactivate_plugins() @@ -315,6 +312,11 @@ class PluginAppConfig(AppConfig): # update urls to remove the apps from the site admin self._update_urls() + def _clean_registry(self): + # remove all plugins from registry + settings.INTEGRATION_PLUGINS = {} + settings.INTEGRATION_PLUGINS_INACTIVE = {} + def _update_urls(self): from InvenTree.urls import urlpatterns from plugin.urls import PLUGIN_BASE, get_integration_urls