Skip to content

Commit

Permalink
Fixes #464: Topology not showing properly when using other language t…
Browse files Browse the repository at this point in the history
…han english (#541)

* Change termination type name to model

* change CHOICES to model names

* Change termination type name to model

* change CHOICES to model names
  • Loading branch information
dreng authored Jul 29, 2024
1 parent 7ff0a96 commit 1048fef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions netbox_topology_views/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ def get_absolute_url(self):
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(
Expand Down
4 changes: 2 additions & 2 deletions netbox_topology_views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1048fef

Please sign in to comment.