Commit 67445717 authored by chirac's avatar chirac
Browse files

Merge branch 'fix_ipv6_clean_from_dev_is_better' into 'dev'

Prevents from crashing where there is no defined prefix_v6

See merge request federez/re2o!384
parents de068f6c c76a5d23
Pipeline #928 failed with stage
......@@ -1380,7 +1380,10 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
.filter(interface=self.interface, slaac_ip=True)
raise ValidationError(_("A SLAAC IP address is already registered."))
prefix_v6 = self.interface.type.ip_type.prefix_v6.encode().decode('utf-8')
prefix_v6 = self.interface.type.ip_type.prefix_v6.encode().decode('utf-8')
except AttributeError: # Prevents from crashing when there is no defined prefix_v6
prefix_v6 = None
if prefix_v6:
if (IPv6Address(self.ipv6.encode().decode('utf-8')).exploded[:20] !=
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment