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

Dirty fix, to fix write

This commit is contained in:
Gabriel Detraz 2020-05-21 18:36:04 +02:00 committed by root
parent 77fa85ae4c
commit 1e838ffe15

View file

@ -1153,11 +1153,13 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
Sans prefixe ipv6, on return Sans prefixe ipv6, on return
Si l'ip slaac n'est pas celle qu'elle devrait être, on maj""" Si l'ip slaac n'est pas celle qu'elle devrait être, on maj"""
ipv6_slaac = self.ipv6_slaac ipv6_slaac = self.ipv6_slaac
print(self.id)
if not ipv6_slaac: if not ipv6_slaac:
return return
ipv6_object = Ipv6List.objects.filter(interface=self, slaac_ip=True).first() ipv6_object = Ipv6List.objects.filter(interface=self, slaac_ip=True).first()
if not ipv6_object: if not ipv6_object:
ipv6_object = Ipv6List(interface=self, slaac_ip=True) ipv6_object = Ipv6List.objects.using("master").create(interface=Interface.objects.using("master").get(id=self.id), slaac_ip=True, ipv6=ipv6_slaac)
return
if ipv6_object.ipv6 != str(ipv6_slaac): if ipv6_object.ipv6 != str(ipv6_slaac):
ipv6_object.ipv6 = str(ipv6_slaac) ipv6_object.ipv6 = str(ipv6_slaac)
ipv6_object.save() ipv6_object.save()
@ -2089,7 +2091,7 @@ def interface_post_save(**kwargs):
"""Synchronisation ldap et régen parefeu/dhcp lors de la modification """Synchronisation ldap et régen parefeu/dhcp lors de la modification
d'une interface""" d'une interface"""
interface = kwargs["instance"] interface = kwargs["instance"]
interface.sync_ipv6() #interface.sync_ipv6()
user = interface.machine.user user = interface.machine.user
user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) user.ldap_sync(base=False, access_refresh=False, mac_refresh=True)
# Regen services # Regen services