From 483466e2d0e919cc0ef3846094e04da7f3eec7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Thu, 14 Sep 2017 18:03:28 +0000 Subject: [PATCH] Ajout de regen pour le service mailing --- cotisations/models.py | 2 ++ users/models.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/cotisations/models.py b/cotisations/models.py index 9778a2d1..71cad990 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -193,8 +193,10 @@ def cotisation_post_save(sender, **kwargs): regen('dns') regen('dhcp') regen('mac_ip_list') + regen('mailing') @receiver(post_delete, sender=Cotisation) def vente_post_delete(sender, **kwargs): cotisation = kwargs['instance'] regen('mac_ip_list') + regen('mailing') diff --git a/users/models.py b/users/models.py index 4107c3d0..38298863 100644 --- a/users/models.py +++ b/users/models.py @@ -463,11 +463,13 @@ def user_post_save(sender, **kwargs): if is_created: user.notif_inscription() user.ldap_sync(base=True, access_refresh=True, mac_refresh=False) + regen('mailing') @receiver(post_delete, sender=User) def user_post_delete(sender, **kwargs): user = kwargs['instance'] user.ldap_del() + regen('mailing') class ServiceUser(AbstractBaseUser): readonly = 'readonly' @@ -642,6 +644,7 @@ def ban_post_save(sender, **kwargs): is_created = kwargs['created'] user = ban.user user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + regen('mailing') if is_created: ban.notif_ban() regen('dhcp') @@ -654,6 +657,7 @@ def ban_post_save(sender, **kwargs): def ban_post_delete(sender, **kwargs): user = kwargs['instance'].user user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + regen('mailing') regen('dhcp') regen('mac_ip_list') @@ -674,6 +678,7 @@ def whitelist_post_save(sender, **kwargs): user = whitelist.user user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) is_created = kwargs['created'] + regen('mailing') if is_created: regen('dhcp') regen('mac_ip_list') @@ -685,6 +690,7 @@ def whitelist_post_save(sender, **kwargs): def whitelist_post_delete(sender, **kwargs): user = kwargs['instance'].user user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + regen('mailing') regen('dhcp') regen('mac_ip_list')