We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0294b4f + 43e65e6 commit 93fe755Copy full SHA for 93fe755
1 file changed
netbox_device_view/template_content.py
@@ -1,11 +1,16 @@
1
from netbox.plugins import PluginTemplateExtension
2
from .utils import prepare
3
from django.conf import settings
4
+from dcim.models import Device
5
6
7
class Ports(PluginTemplateExtension):
8
def page(self):
9
obj = self.context["object"]
10
+
11
+ if not isinstance(obj, Device):
12
+ return ""
13
14
request = self.context["request"]
15
url = request.build_absolute_uri(obj.get_absolute_url())
16
@@ -31,7 +36,7 @@ class DevicePorts(Ports):
31
36
model = "dcim.device"
32
37
33
38
def full_width_page(self):
34
- if settings.PLUGINS_CONFIG["netbox_device_view"]["show_on_device_tab"] == False:
39
+ if not settings.PLUGINS_CONFIG["netbox_device_view"]["show_on_device_tab"]:
35
40
return ""
41
return self.page()
42
0 commit comments