From 6c5dd2a5a41def748c5d9e91583b5da6c23d94b4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 17 Nov 2021 01:59:30 +0100 Subject: [PATCH] and safety here too --- InvenTree/plugin/apps.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index 9232eda992..decbd333d2 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -229,7 +229,11 @@ class PluginAppConfig(AppConfig): those register models and admin in their respective objects (e.g. admin.site for admin) """ for plugin_path in settings.INTEGRATION_APPS_PATHS: - app_config = apps.get_app_config(plugin_path.split('.')[-1]) + try: + app_config = apps.get_app_config(plugin_path.split('.')[-1]) + except LookupError: + # the plugin was never loaded correctly + break # reload models if they were set # models_module gets set if models were defined - even after multiple loads