Skip to content

Commit

Permalink
[fix] Fixed get_name admin short description in device integration
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Jul 1, 2024
1 parent 55f9ef2 commit 60a00a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openwisp_network_topology/integrations/device/overrides.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import swapper
from django.utils.translation import gettext_lazy as _

Node = swapper.load_model('topology', 'Node')
Link = swapper.load_model('topology', 'Link')
Expand Down Expand Up @@ -107,6 +108,7 @@ def link_get_queryset(cls, qs):


Node.get_name = get_name
Node.get_name.short_description = _('label')
Node.get_organization_id = node_get_organization_id
Node.get_queryset = node_get_queryset
Link.get_queryset = link_get_queryset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,8 @@ def test_topology_admin(self):
reverse(f'{self.prefix}_topology_change', args=[topology.id])
)
self.assertNotContains(response, 'Wifi mesh')

def test_topology_get_name_desc(self):
response = self.client.get(reverse(f'{self.prefix}_node_changelist'))
self.assertNotContains(response, '<span>Get name</span>', html=True)
self.assertContains(response, '<span>Label</span>', html=True)

0 comments on commit 60a00a3

Please sign in to comment.