From 659192e36912ee077c1f4a44a16046719e4905e8 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 +++++++++++++++++-- .../templates/machines/index_extension.html | 4 +-- 2 files changed, 28 insertions(+), 4 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') diff --git a/machines/templates/machines/index_extension.html b/machines/templates/machines/index_extension.html index 6c0bb6a9..20587d85 100644 --- a/machines/templates/machines/index_extension.html +++ b/machines/templates/machines/index_extension.html @@ -49,8 +49,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include "machines/aff_ns.html" with ns_list=ns_list %}

Liste des enregistrements Text

{% if is_infra %} - Ajouter un enregistrement MX - Supprimer un enregistrement MX + Ajouter un enregistrement TXT + Supprimer un enregistrement TXT {% endif %} {% include "machines/aff_text.html" with text_list=text_list %}