Only notify a player of finished influence changes.
authorMatthijs Kooijman <matthijs@stdio.flexvps.nl>
Mon, 16 Feb 2009 19:23:06 +0000 (20:23 +0100)
committerMatthijs Kooijman <matthijs@stdio.flexvps.nl>
Mon, 16 Feb 2009 19:23:06 +0000 (20:23 +0100)
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

index ddcf37cea7b06c5770e98ee5f8be0eec2e03fe07..daffadf5cb4a53aa42a3967ce5c394eb3ddaa9fe 100644 (file)
@@ -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)