mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 02:55:41 +00:00
only check if plugin urls are enabled if db ready
This commit is contained in:
@ -31,6 +31,7 @@ from report.api import report_api_urls
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
|
from django.db.utils import OperationalError, ProgrammingError
|
||||||
|
|
||||||
from django.views.generic.base import RedirectView
|
from django.views.generic.base import RedirectView
|
||||||
from rest_framework.documentation import include_docs_urls
|
from rest_framework.documentation import include_docs_urls
|
||||||
@ -127,15 +128,14 @@ translated_javascript_urls = [
|
|||||||
|
|
||||||
# Integration plugin urls
|
# Integration plugin urls
|
||||||
interation_urls = []
|
interation_urls = []
|
||||||
plugin_url_enabled = False
|
|
||||||
try:
|
try:
|
||||||
plugin_url_enabled = InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL')
|
if settings.TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'):
|
||||||
except Exception as _e:
|
for plugin in settings.INTEGRATION_PLUGINS.values():
|
||||||
print(_e)
|
if plugin.mixin_enabled('urls'):
|
||||||
if settings.TESTING or plugin_url_enabled:
|
interation_urls.append(plugin.urlpatterns)
|
||||||
for plugin in settings.INTEGRATION_PLUGINS.values():
|
except (OperationalError, ProgrammingError):
|
||||||
if plugin.mixin_enabled('urls'):
|
# Exception if the database has not been migrated yet
|
||||||
interation_urls.append(plugin.urlpatterns)
|
pass
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^part/', include(part_urls)),
|
url(r'^part/', include(part_urls)),
|
||||||
|
Reference in New Issue
Block a user