X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=influences%2Fnotify.py;h=daffadf5cb4a53aa42a3967ce5c394eb3ddaa9fe;hb=08ad5cd72af1795f3e0750413bcdbbee54c14c25;hp=ddcf37cea7b06c5770e98ee5f8be0eec2e03fe07;hpb=89667723f59df28360a5e12dd969a8b190caa8d9;p=matthijs%2Fprojects%2Fxerxes.git 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)