safe url loading

This commit is contained in:
Matthias 2021-10-18 23:03:00 +02:00
parent b36a1d47e1
commit 6147b079d1
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -127,7 +127,12 @@ translated_javascript_urls = [
# Integration plugin urls
interation_urls = []
if settings.TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'):
plugin_url_enabled = False
try:
plugin_url_enabled = InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL')
except Exception as _e:
print(_e)
if settings.TESTING or plugin_url_enabled:
for plugin in settings.INTEGRATION_PLUGINS.values():
if plugin.mixin_enabled('urls'):
interation_urls.append(plugin.urlpatterns)