Skip to content

Commit 1048fef

Browse files
authored
Fixes #464: Topology not showing properly when using other language than english (#541)
* Change termination type name to model * change CHOICES to model names * Change termination type name to model * change CHOICES to model names
1 parent 7ff0a96 commit 1048fef

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

netbox_topology_views/models.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ def get_absolute_url(self):
331331
class IndividualOptions(NetBoxModel):
332332
CHOICES = (
333333
('interface', 'interface'),
334-
('front port', 'front port'),
335-
('rear port', 'rear port'),
336-
('power outlet', 'power outlet'),
337-
('power port', 'power port'),
338-
('console port', 'console port'),
339-
('console server port', 'console server port'),
334+
('frontport', 'frontport'),
335+
('rearport', 'rearport'),
336+
('poweroutlet', 'poweroutlet'),
337+
('powerport', 'powerport'),
338+
('consoleport', 'consoleport'),
339+
('consoleserverport', 'consoleserverport'),
340340
)
341341

342342
user_id = models.IntegerField(

netbox_topology_views/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,11 @@ def get_topology_data(
560560
).select_related("termination_type")
561561

562562
for link in links:
563-
if link.termination_type.name in ignore_cable_type:
563+
if link.termination_type.model in ignore_cable_type:
564564
continue
565565

566566
# Normal device cables
567-
if link.termination_type.name in supported_termination_types:
567+
if link.termination_type.model in supported_termination_types:
568568
complete_link = False
569569
if link.cable_end == "A":
570570
if link.cable_id not in cable_ids:

0 commit comments

Comments
 (0)