Commit fb6a5226 authored by Maël Kervella's avatar Maël Kervella Committed by Pierre Cadart

Filtre les mac illisibles, non valide et None

parent 6dbfbb89
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment