8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 11:53:12 +00:00

Oublie d'un __in

This commit is contained in:
Gabriel Detraz 2016-12-14 19:07:20 +01:00 committed by root
parent 5f4fdf8d9a
commit 6108d303f2

View file

@ -113,7 +113,7 @@ class Alias(models.Model):
def clean(self, *args, **kwargs): def clean(self, *args, **kwargs):
if hasattr(self, 'alias') and hasattr(self, 'extension'): if hasattr(self, 'alias') and hasattr(self, 'extension'):
if Interface.objects.filter(dns=self.alias).filter(ipv4=IpList.objects.filter(ip_type=IpType.objects.filter(extension=self.extension))): if Interface.objects.filter(dns=self.alias).filter(ipv4__in=IpList.objects.filter(ip_type__in=IpType.objects.filter(extension=self.extension))):
raise ValidationError("Impossible d'ajouter l'alias, déjà utilisé par une machine") raise ValidationError("Impossible d'ajouter l'alias, déjà utilisé par une machine")
def __str__(self): def __str__(self):