From 6103fbad790d284b85eb47f6612a1575885460f1 Mon Sep 17 00:00:00 2001 From: Alice Date: Sat, 1 Apr 2017 20:33:14 +0200 Subject: [PATCH] Stop sending emails to staff on staff ticket replies --- tickets/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tickets/models.py b/tickets/models.py index 8adf035..c021811 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -71,7 +71,8 @@ class Ticket(models.Model): url = ROOT_URL + reverse('tickets:view', args=(self.id,)) subject = _("Ticket:") + " " + self.subject ctx = dict(ticket=self, message=message, url=url) - notify(subject, 'tickets/mail_support_reply.txt', self.get_contacts(), ctx) + if message.user == self.user: + notify(subject, 'tickets/mail_support_reply.txt', self.get_contacts(), ctx) if self.user and self.user.email: if message.staff_only and not self.user.has_perm('tickets.view_private_message'): return