mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Fix urls loading for plugin testing (#6383)
* Fix urls for plugin testing * Fix pre-commit * Only load urls if testing setup is true
This commit is contained in:
parent
9197517f38
commit
577185cd98
@ -1,5 +1,6 @@
|
|||||||
"""URL lookup for plugin app."""
|
"""URL lookup for plugin app."""
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.urls import include, re_path
|
from django.urls import include, re_path
|
||||||
|
|
||||||
PLUGIN_BASE = 'plugin' # Constant for links
|
PLUGIN_BASE = 'plugin' # Constant for links
|
||||||
@ -13,8 +14,11 @@ def get_plugin_urls():
|
|||||||
urls = []
|
urls = []
|
||||||
|
|
||||||
# Only allow custom routing if the setting is enabled
|
# Only allow custom routing if the setting is enabled
|
||||||
if InvenTreeSetting.get_setting(
|
if (
|
||||||
'ENABLE_PLUGINS_URL', False, create=False, cache=False
|
InvenTreeSetting.get_setting(
|
||||||
|
'ENABLE_PLUGINS_URL', False, create=False, cache=False
|
||||||
|
)
|
||||||
|
or settings.PLUGIN_TESTING_SETUP
|
||||||
):
|
):
|
||||||
for plugin in registry.plugins.values():
|
for plugin in registry.plugins.values():
|
||||||
if plugin.mixin_enabled('urls'):
|
if plugin.mixin_enabled('urls'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user