testing save navigation checks

This commit is contained in:
Matthias 2021-10-17 19:50:06 +02:00
parent 56d198edb5
commit 487ac594bb
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 10 additions and 1 deletions

View File

@ -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')

View File

@ -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 %}
<nav class="navbar navbar-xs navbar-default navbar-fixed-top ">
<div class="container-fluid">