mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 22:52:26 +00:00
Surcharge mais n'override pas le clean
This commit is contained in:
parent
a0fa7cb718
commit
70b2368560
1 changed files with 2 additions and 0 deletions
|
@ -165,8 +165,10 @@ class Interface(models.Model):
|
||||||
return str(EUI(self.mac_address, dialect=mac_bare)).lower()
|
return str(EUI(self.mac_address, dialect=mac_bare)).lower()
|
||||||
|
|
||||||
def clean(self, *args, **kwargs):
|
def clean(self, *args, **kwargs):
|
||||||
|
self.mac_address = str(EUI(self.mac_address)) or None
|
||||||
if not self.ipv4 or self.type.ip_type != self.ipv4.ip_type:
|
if not self.ipv4 or self.type.ip_type != self.ipv4.ip_type:
|
||||||
self.assign_ipv4()
|
self.assign_ipv4()
|
||||||
|
super(Interface, self).clean(*args, **kwargs)
|
||||||
|
|
||||||
def assign_ipv4(self):
|
def assign_ipv4(self):
|
||||||
""" Assigne une ip à l'interface """
|
""" Assigne une ip à l'interface """
|
||||||
|
|
Loading…
Reference in a new issue