mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +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()
|
||||
|
||||
def filter_macaddress(self):
|
||||
mac_address = str(EUI(self.mac_address))
|
||||
if mac_address:
|
||||
self.mac_address = mac_address
|
||||
else:
|
||||
try:
|
||||
self.mac_address = str(EUI(self.mac_address))
|
||||
except :
|
||||
raise ValidationError("La mac donnée est invalide")
|
||||
|
||||
def clean(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue