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
This commit is contained in:
Mario
2024-07-29 10:32:30 +02:00
committed by GitHub
parent 7ff0a9650f
commit 1048feff52
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -331,12 +331,12 @@ class PowerFeedCoordinate(NetBoxModel):
class IndividualOptions(NetBoxModel):
CHOICES = (
('interface', 'interface'),
('front port', 'front port'),
('rear port', 'rear port'),
('power outlet', 'power outlet'),
('power port', 'power port'),
('console port', 'console port'),
('console server port', 'console server port'),
('frontport', 'frontport'),
('rearport', 'rearport'),
('poweroutlet', 'poweroutlet'),
('powerport', 'powerport'),
('consoleport', 'consoleport'),
('consoleserverport', 'consoleserverport'),
)
user_id = models.IntegerField(
+2 -2
View File
@@ -560,11 +560,11 @@ def get_topology_data(
).select_related("termination_type")
for link in links:
if link.termination_type.name in ignore_cable_type:
if link.termination_type.model in ignore_cable_type:
continue
# Normal device cables
if link.termination_type.name in supported_termination_types:
if link.termination_type.model in supported_termination_types:
complete_link = False
if link.cable_end == "A":
if link.cable_id not in cable_ids: