8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 18:03:45 +00:00

Lors de la modification d'une machine, on maj aussi le ldap

This commit is contained in:
Gabriel Detraz 2017-03-10 00:05:53 +01:00 committed by root
parent 82054aa8f2
commit 8ce74665d6

View file

@ -150,6 +150,16 @@ class IpList(models.Model):
def __str__(self):
return self.ipv4
@receiver(post_save, sender=Machine)
def machine_post_save(sender, **kwargs):
user = kwargs['instance'].user
user.ldap_sync(base=False, access_refresh=False, mac_refresh=True)
@receiver(post_delete, sender=Machine)
def machine_post_delete(sender, **kwargs):
machine = kwargs['instance']
user = machine.user
user.ldap_sync(base=False, access_refresh=False, mac_refresh=True)
@receiver(post_save, sender=Interface)
def interface_post_save(sender, **kwargs):