From 08ad5cd72af1795f3e0750413bcdbbee54c14c25 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 16 Feb 2009 20:23:06 +0100 Subject: [PATCH] Only notify a player of finished influence changes. SLs are notified of any change, but players only receive email notification of influences that are marked as done, to reduce noise. --- influences/notify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/influences/notify.py b/influences/notify.py index ddcf37c..daffadf 100644 --- a/influences/notify.py +++ b/influences/notify.py @@ -18,8 +18,10 @@ def influence_saved(**kwargs): instance = kwargs['instance'] created = kwargs['created'] if (not settings.DEBUG): - # TODO: Perhaps only notify when the status is / becomes Done? - notify([instance.character.player, 'lextalionis@evolution-events.nl'], 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created}) + recipients = ['lextalionis@evolution-events.nl'] + if instance.status == 'D': + recipients.append(instance.character.player) + notify(recipients, 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created}) signals.post_save.connect(influence_saved, sender=Influence) -- 2.30.2