X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=influences%2Fnotify.py;h=3b5d874b5239a6e05390307b5449c41edc867d9a;hb=208bc91fbcd12576310cb405f0a713f14429b2a1;hp=e5c763ae36b40dea3d20b39d324233b8aad15378;hpb=419cb678949006d2c5bd6bf5a3176c67adf4cef7;p=matthijs%2Fprojects%2Fxerxes.git diff --git a/influences/notify.py b/influences/notify.py index e5c763a..3b5d874 100644 --- a/influences/notify.py +++ b/influences/notify.py @@ -17,23 +17,30 @@ signals.post_save.connect(character_saved, sender=Character) def influence_saved(**kwargs): instance = kwargs['instance'] created = kwargs['created'] + recipients = ['lextalionis@evolution-events.nl'] + recipients.extend(instance.related_players.keys()) 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}) + notify(recipients, 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created}) def comment_saved(**kwargs): if (settings.DEBUG): return comment = kwargs['instance'] + # We don't support comment editing, but let's check this anyway if not kwargs['created']: return object = comment.content_object if isinstance(object, Influence): + recipients = ['lextalionis@evolution-events.nl'] + if comment.is_public: + recipients.extend(object.related_players.keys()) + notify( - [object.character.player, 'matthijs@stdin.nl'], + recipients, 'influences/email/influence_comment_added.html', {'comment' : comment, 'influence' : object,