2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 19:46:46 +00:00

Backport: Fix urls loading for plugin testing (#6383) (#6384)

This commit is contained in:
Lukas 2024-02-01 21:00:14 +01:00 committed by GitHub
parent a05e07b2dd
commit c826b8231f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,7 +14,7 @@ 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'):
urls.append(plugin.urlpatterns)