mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 03:43:12 +00:00
Filtre les mac illisibles, non valide et None
This commit is contained in:
parent
8a1ba00ed9
commit
a74be1dffd
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