use namespaces for urls

This commit is contained in:
Matthias 2021-09-19 16:44:32 +02:00
parent 22ee631af5
commit 3edabc810e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 3 additions and 3 deletions

View File

@ -179,7 +179,7 @@ urlpatterns = [
url(r'^api-doc/', include_docs_urls(title='InvenTree API')), url(r'^api-doc/', include_docs_urls(title='InvenTree API')),
# plugins # plugins
url(f'^{settings.PLUGIN_URL}/', include(interation_urls)), url(f'^{settings.PLUGIN_URL}/', include((interation_urls, 'plugin'))),
url(r'^markdownx/', include('markdownx.urls')), url(r'^markdownx/', include('markdownx.urls')),
] ]

View File

@ -64,7 +64,7 @@ class UrlsMixin:
retruns the urlpatterns for this plugin retruns the urlpatterns for this plugin
""" """
if self.has_urls: if self.has_urls:
return url(f'^{self.plugin_name()}/', include(self.urls), name=self.plugin_name()) return url(f'^{self.plugin_name()}/', include((self.urls, self.plugin_name())), name=self.plugin_name())
return None return None
@property @property

View File

@ -35,7 +35,7 @@ class SampleIntegrationPlugin(SettingsMixin, UrlsMixin, NavigationMixin, Integra
} }
NAVIGATION= [ NAVIGATION= [
{'name': 'SampleIntegration', 'link': 'SampleIntegrationPlugin:hi'}, {'name': 'SampleIntegration', 'link': 'plugin:SampleIntegrationPlugin:hi'},
] ]