8
0
Fork 0
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:
Gabriel Detraz 2017-08-08 00:01:45 +02:00 committed by root
parent 3b11409d68
commit 55a0be1d15

View file

@ -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 """