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