mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-24 16:03:47 +00:00
Merge branch 'crans' of https://gitlab.federez.net/federez/re2o into crans
This commit is contained in:
commit
73eb16e16d
1 changed files with 3 additions and 6 deletions
|
@ -327,12 +327,9 @@ class IpType(RevMixin, AclMixin, models.Model):
|
|||
crée les ip une par une. Si elles existent déjà, met à jour le type
|
||||
associé à l'ip"""
|
||||
# Creation du range d'ip dans les objets iplist
|
||||
networks = []
|
||||
for net in self.ip_range.cidrs():
|
||||
networks += net.iter_hosts()
|
||||
ip_obj = [IpList(ip_type=self, ipv4=str(ip)) for ip in networks]
|
||||
ip_obj = [IpList(ip_type=self, ipv4=str(ip)) for ip in self.ip_range]
|
||||
listes_ip = IpList.objects.filter(
|
||||
ipv4__in=[str(ip) for ip in networks]
|
||||
ipv4__in=[str(ip) for ip in self.ip_range]
|
||||
)
|
||||
# Si il n'y a pas d'ip, on les crée
|
||||
if not listes_ip:
|
||||
|
@ -752,7 +749,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
|||
blank=True,
|
||||
null=True
|
||||
)
|
||||
mac_address = MACAddressField(integer=False, unique=True)
|
||||
mac_address = MACAddressField(integer=False)
|
||||
machine = models.ForeignKey('Machine', on_delete=models.CASCADE)
|
||||
type = models.ForeignKey('MachineType', on_delete=models.PROTECT)
|
||||
details = models.CharField(max_length=255, blank=True)
|
||||
|
|
Loading…
Reference in a new issue