mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Filtre les mac illisibles, non valide et None
This commit is contained in:
parent
6dbfbb894a
commit
fb6a522614
1 changed files with 3 additions and 4 deletions
|
@ -235,10 +235,9 @@ 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 filter_macaddress(self):
|
def filter_macaddress(self):
|
||||||
mac_address = str(EUI(self.mac_address))
|
try:
|
||||||
if mac_address:
|
self.mac_address = str(EUI(self.mac_address))
|
||||||
self.mac_address = mac_address
|
except :
|
||||||
else:
|
|
||||||
raise ValidationError("La mac donnée est invalide")
|
raise ValidationError("La mac donnée est invalide")
|
||||||
|
|
||||||
def clean(self, *args, **kwargs):
|
def clean(self, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue