From 577185cd9832097791bed4ff79a581473e24c001 Mon Sep 17 00:00:00 2001 From: Lukas <76838159+wolflu05@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:16:47 +0100 Subject: [PATCH] Fix urls loading for plugin testing (#6383) * Fix urls for plugin testing * Fix pre-commit * Only load urls if testing setup is true --- InvenTree/plugin/urls.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/InvenTree/plugin/urls.py b/InvenTree/plugin/urls.py index dc25226171..a551d9d9e5 100644 --- a/InvenTree/plugin/urls.py +++ b/InvenTree/plugin/urls.py @@ -1,5 +1,6 @@ """URL lookup for plugin app.""" +from django.conf import settings from django.urls import include, re_path PLUGIN_BASE = 'plugin' # Constant for links @@ -13,8 +14,11 @@ def get_plugin_urls(): urls = [] # Only allow custom routing if the setting is enabled - if InvenTreeSetting.get_setting( - 'ENABLE_PLUGINS_URL', False, create=False, cache=False + if ( + InvenTreeSetting.get_setting( + 'ENABLE_PLUGINS_URL', False, create=False, cache=False + ) + or settings.PLUGIN_TESTING_SETUP ): for plugin in registry.plugins.values(): if plugin.mixin_enabled('urls'):