diff --git a/src/NAC_Service_Portal/settings.py b/src/NAC_Service_Portal/settings.py
index 283375a..ac026b6 100644
--- a/src/NAC_Service_Portal/settings.py
+++ b/src/NAC_Service_Portal/settings.py
@@ -68,6 +68,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+ 'nac.context_processors.armis_context',
],
},
},
diff --git a/src/nac/context_processors.py b/src/nac/context_processors.py
new file mode 100644
index 0000000..4687540
--- /dev/null
+++ b/src/nac/context_processors.py
@@ -0,0 +1,11 @@
+from helper.armis import get_tenant_url
+from django.core.cache import cache
+
+
+# is armis configured? We need this to render to nav-bar correctly
+def armis_context(request):
+ armis_is_configured = cache.get("armis_is_configured")
+ if armis_is_configured is None:
+ armis_is_configured = get_tenant_url() != "https://"
+ cache.set("armis_is_configured", armis_is_configured)
+ return {"armis_is_configured": armis_is_configured}
diff --git a/src/templates/base.html b/src/templates/base.html
index f7df82c..8e98d94 100644
--- a/src/templates/base.html
+++ b/src/templates/base.html
@@ -66,6 +66,7 @@
Add Device
+ {% if armis_is_configured %}
Armis Import
-
+
+ {% endif %}