mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 15:12:25 +00:00
Surcharge mais n'override pas le clean
This commit is contained in:
parent
3b11409d68
commit
55a0be1d15
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()
|
||||
|
||||
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:
|
||||
self.assign_ipv4()
|
||||
super(Interface, self).clean(*args, **kwargs)
|
||||
|
||||
def assign_ipv4(self):
|
||||
""" Assigne une ip à l'interface """
|
||||
|
|
Loading…
Reference in a new issue