Commit b9030ecf authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Le check ne doit etre fait que si il y a une ip

parent 71eed60a
......@@ -411,9 +411,10 @@ class Interface(models.Model):
def save(self, *args, **kwargs):
self.filter_macaddress()
# On verifie la cohérence en forçant l'extension par la méthode
if self.type.ip_type != self.ipv4.ip_type:
raise ValidationError("L'ipv4 et le type de la machine ne\
correspondent pas")
if self.ipv4:
if self.type.ip_type != self.ipv4.ip_type:
raise ValidationError("L'ipv4 et le type de la machine ne\
correspondent pas")
super(Interface, self).save(*args, **kwargs)
def __str__(self):
......
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