From 295f7fa5fa65afb1b9454e0e0d9c83f1b2a98cf5 Mon Sep 17 00:00:00 2001 From: Grizzly Date: Sat, 10 Aug 2019 22:41:33 +0000 Subject: [PATCH] Pas d'envoit de mail pour les updates --- tickets/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tickets/models.py b/tickets/models.py index 6af24c4c..85857a1f 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -72,6 +72,7 @@ class Preferences(models.Model): @receiver(post_save, sender=Ticket) def ticket_post_save(**kwargs): """Envoit du mail de publication du ticket""" - if Preferences.objects.first().publish_address: - ticket = kwargs['instance'] - ticket.publish_mail() + if kwargs['created']: + if Preferences.objects.first().publish_address: + ticket = kwargs['instance'] + ticket.publish_mail()