refactor registry cleaning

This commit is contained in:
Matthias 2021-11-20 03:03:57 +01:00
parent ce71508d8d
commit ad98c1df48
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

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