diff --git a/InvenTree/part/templatetags/plugin_extras.py b/InvenTree/part/templatetags/plugin_extras.py index e0592f8f28..590b89d7ae 100644 --- a/InvenTree/part/templatetags/plugin_extras.py +++ b/InvenTree/part/templatetags/plugin_extras.py @@ -5,6 +5,8 @@ from django.conf import settings as djangosettings from django import template +from common.models import InvenTreeSetting + register = template.Library() @@ -25,3 +27,10 @@ def plugin_settings(plugin, *args, **kwargs): def mixin_enabled(plugin, key, *args, **kwargs): """ Return if the mixin is existant and configured in the plugin """ return plugin.mixin_enabled(key) + +@register.simple_tag() +def navigation_enabled(*args, **kwargs): + """Return if plugin navigation is enabled""" + if djangosettings.TESTING: + return True + return InvenTreeSetting.get_setting('ENABLE_PLUGINS_NAVIGATION') diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index c2f6038041..ad49ecf401 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -4,7 +4,7 @@ {% load i18n %} {% settings_value 'BARCODE_ENABLE' as barcodes %} -{% settings_value 'ENABLE_PLUGINS_NAVIGATION' as plugin_nav %} +{% navigation_enabled as plugin_nav %}