Skip to content

Commit 93fe755

Browse files
authored
Merge pull request #46 from joeladria/bugfix/port-chassis-empty
2 parents 0294b4f + 43e65e6 commit 93fe755

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

netbox_device_view/template_content.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
from netbox.plugins import PluginTemplateExtension
22
from .utils import prepare
33
from django.conf import settings
4+
from dcim.models import Device
45

56

67
class Ports(PluginTemplateExtension):
78
def page(self):
89
obj = self.context["object"]
10+
11+
if not isinstance(obj, Device):
12+
return ""
13+
914
request = self.context["request"]
1015
url = request.build_absolute_uri(obj.get_absolute_url())
1116

@@ -31,7 +36,7 @@ class DevicePorts(Ports):
3136
model = "dcim.device"
3237

3338
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"]:
3540
return ""
3641
return self.page()
3742

0 commit comments

Comments
 (0)