From c49607650561e1ba57e21ea896da304da6a1e41d Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 22 Nov 2021 00:52:42 +0100 Subject: [PATCH] check if file plugin was disabled --- InvenTree/plugin/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/registry.py b/InvenTree/plugin/registry.py index c6be538d1e..2ec7ff9131 100644 --- a/InvenTree/plugin/registry.py +++ b/InvenTree/plugin/registry.py @@ -184,7 +184,8 @@ class Plugins: if settings.PLUGIN_TESTING or (plugin_db_setting and plugin_db_setting.active): # check if the plugin was blocked -> threw an error if disabled: - if plugin.__name__ == disabled: + # option1: package, option2: file-based + if (plugin.__name__ == disabled) or (plugin.__module__==disabled): # errors are bad so disable the plugin in the database # but only if not in testing mode as that breaks in the GH pipeline log_plugin_error({plug_key: 'Disabled'}, 'init')