From 809f55e011ce98156f41605ac847407128fc321d Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 5 Sep 2017 18:23:25 +0200 Subject: [PATCH] Regeneration du dns quand modification des reglages de zone --- machines/models.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/machines/models.py b/machines/models.py index ccada7d6..4cf3941c 100644 --- a/machines/models.py +++ b/machines/models.py @@ -406,6 +406,30 @@ def machine_post_save(sender, **kwargs): def domain_post_save(sender, **kwargs): regen('dns') -@receiver(post_save, sender=Domain) -def domain_post_save(sender, **kwargs): +@receiver(post_delete, sender=Domain) +def domain_post_delete(sender, **kwargs): + regen('dns') + +@receiver(post_save, sender=Mx) +def mx_post_save(sender, **kwargs): + regen('dns') + +@receiver(post_delete, sender=Mx) +def mx_post_delete(sender, **kwargs): + regen('dns') + +@receiver(post_save, sender=Ns) +def ns_post_save(sender, **kwargs): + regen('dns') + +@receiver(post_delete, sender=Ns) +def ns_post_delete(sender, **kwargs): + regen('dns') + +@receiver(post_save, sender=Text) +def text_post_save(sender, **kwargs): + regen('dns') + +@receiver(post_delete, sender=Text) +def text_post_delete(sender, **kwargs): regen('dns')