mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 07:23:46 +00:00
Don't use disabled ip for administration purpose
This commit is contained in:
parent
2d6d1a6024
commit
383aaf3132
3 changed files with 4 additions and 4 deletions
|
@ -1365,11 +1365,11 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
DHCPv6).
|
||||
"""
|
||||
if preferences.models.OptionalMachine.get_cached_value("ipv6_mode") == "SLAAC":
|
||||
return self.ipv6list.all()
|
||||
return self.ipv6list.filter(active=True)
|
||||
elif (
|
||||
preferences.models.OptionalMachine.get_cached_value("ipv6_mode") == "DHCPV6"
|
||||
):
|
||||
return self.ipv6list.filter(slaac_ip=False)
|
||||
return self.ipv6list.filter(active=True).filter(slaac_ip=False)
|
||||
else:
|
||||
return []
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ class OptionalTopologie(AclMixin, PreferencesModel):
|
|||
def return_ips_dict(interfaces):
|
||||
return {
|
||||
"ipv4": [str(interface.ipv4) for interface in interfaces],
|
||||
"ipv6": Ipv6List.objects.filter(interface__in=interfaces).values_list(
|
||||
"ipv6": Ipv6List.objects.filter(interface__in=interfaces).filter(active=True).values_list(
|
||||
"ipv6", flat=True
|
||||
),
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ class Switch(Machine):
|
|||
def return_ips_dict(interfaces):
|
||||
return {
|
||||
"ipv4": [str(interface.ipv4) for interface in interfaces],
|
||||
"ipv6": Ipv6List.objects.filter(interface__in=interfaces).values_list(
|
||||
"ipv6": Ipv6List.objects.filter(interface__in=interfaces).filter(active=True).values_list(
|
||||
"ipv6", flat=True
|
||||
),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue