Просмотр исходного кода

Fixes #2663: Prevent duplicate interfaces from appearing under VLAN members view

Jeremy Stretch 7 лет назад
Родитель
Сommit
2418fed65b
3 измененных файлов с 4 добавлено и 3 удалено
  1. 2 1
      CHANGELOG.md
  2. 1 1
      netbox/ipam/models.py
  3. 1 1
      netbox/ipam/tables.py

+ 2 - 1
CHANGELOG.md

@@ -2,11 +2,12 @@ v2.5.1 (FUTURE)
 
 
 ## Enhancements
 ## Enhancements
 
 
-* [#2655](https://github.com/digitalocean/netbox/issues/265) - Add 128GFC Fibrechannel interface type
+* [#2655](https://github.com/digitalocean/netbox/issues/2655) - Add 128GFC Fibrechannel interface type
 
 
 ## Bug Fixes
 ## Bug Fixes
 
 
 * [#2662](https://github.com/digitalocean/netbox/issues/2662) - Fix ImproperlyConfigured exception when rendering API docs
 * [#2662](https://github.com/digitalocean/netbox/issues/2662) - Fix ImproperlyConfigured exception when rendering API docs
+* [#2663](https://github.com/digitalocean/netbox/issues/2663) - Prevent duplicate interfaces from appearing under VLAN members view
 * [#2666](https://github.com/digitalocean/netbox/issues/2666) - Correct display of length unit in cables list
 * [#2666](https://github.com/digitalocean/netbox/issues/2666) - Correct display of length unit in cables list
 * [#2676](https://github.com/digitalocean/netbox/issues/2676) - Fix exception when passing dictionary value to a ChoiceField
 * [#2676](https://github.com/digitalocean/netbox/issues/2676) - Fix exception when passing dictionary value to a ChoiceField
 * [#2678](https://github.com/digitalocean/netbox/issues/2678) - Fix error when viewing webhook in admin UI without write permission
 * [#2678](https://github.com/digitalocean/netbox/issues/2678) - Fix error when viewing webhook in admin UI without write permission

+ 1 - 1
netbox/ipam/models.py

@@ -812,7 +812,7 @@ class VLAN(ChangeLoggedModel, CustomFieldModel):
         return Interface.objects.filter(
         return Interface.objects.filter(
             Q(untagged_vlan_id=self.pk) |
             Q(untagged_vlan_id=self.pk) |
             Q(tagged_vlans=self.pk)
             Q(tagged_vlans=self.pk)
-        )
+        ).distinct()
 
 
 
 
 class Service(ChangeLoggedModel, CustomFieldModel):
 class Service(ChangeLoggedModel, CustomFieldModel):

+ 1 - 1
netbox/ipam/tables.py

@@ -430,7 +430,7 @@ class VLANDetailTable(VLANTable):
 
 
 class VLANMemberTable(BaseTable):
 class VLANMemberTable(BaseTable):
     parent = tables.LinkColumn(order_by=['device', 'virtual_machine'])
     parent = tables.LinkColumn(order_by=['device', 'virtual_machine'])
-    name = tables.Column(verbose_name='Interface')
+    name = tables.LinkColumn(verbose_name='Interface')
     untagged = tables.TemplateColumn(
     untagged = tables.TemplateColumn(
         template_code=VLAN_MEMBER_UNTAGGED,
         template_code=VLAN_MEMBER_UNTAGGED,
         orderable=False
         orderable=False