From b05381fcc87d94ace923c682b0fb85d6420c95a6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 20 Nov 2021 13:00:12 +0100 Subject: [PATCH] rename / cleanup --- InvenTree/InvenTree/urls.py | 5 ++--- InvenTree/plugin/apps.py | 4 ++-- InvenTree/plugin/urls.py | 6 +----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 2a70ea6e14..a0900c3fd4 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -18,7 +18,7 @@ from part.urls import part_urls from stock.urls import stock_urls from build.urls import build_urls from order.urls import order_urls -from plugin.urls import plugin_urls, get_integration_urls +from plugin.urls import get_plugin_urls from barcodes.api import barcode_api_urls from common.api import common_api_urls @@ -159,8 +159,7 @@ urlpatterns = [ url(r'^api-doc/', include_docs_urls(title='InvenTree API')), # plugin urls - url(r'^plugins/', include(plugin_urls)), - get_integration_urls(), # appends currently loaded plugin urls = None + get_plugin_urls(), # appends currently loaded plugin urls = None url(r'^markdownx/', include('markdownx.urls')), diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index c518e185f2..4f94a773ac 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -385,14 +385,14 @@ class PluginAppConfig(AppConfig): def _update_urls(self): from InvenTree.urls import urlpatterns - from plugin.urls import get_integration_urls + from plugin.urls import get_plugin_urls for index, a in enumerate(urlpatterns): if hasattr(a, 'app_name'): if a.app_name == 'admin': urlpatterns[index] = url(r'^admin/', admin.site.urls, name='inventree-admin') elif a.app_name == 'plugin': - urlpatterns[index] = get_integration_urls() + urlpatterns[index] = get_plugin_urls() clear_url_caches() def _reload_apps(self, force_reload: bool = False): diff --git a/InvenTree/plugin/urls.py b/InvenTree/plugin/urls.py index 76de305ebc..29c6ecb32e 100644 --- a/InvenTree/plugin/urls.py +++ b/InvenTree/plugin/urls.py @@ -8,14 +8,10 @@ from django.conf.urls import url, include PLUGIN_BASE = 'plugin' # Constant for links -def get_integration_urls(): +def get_plugin_urls(): """returns a urlpattern that can be integrated into the global urls""" urls = [] for plugin in settings.INTEGRATION_PLUGINS.values(): if plugin.mixin_enabled('urls'): urls.append(plugin.urlpatterns) return url(f'^{PLUGIN_BASE}/', include((urls, 'plugin'))) - - -plugin_urls = [ -]