From: Matthijs Kooijman Date: Sat, 31 Jan 2009 10:20:21 +0000 (+0100) Subject: Send influence notifications to all players involved. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fxerxes.git;a=commitdiff_plain;h=0bb81ee5973a3fb3096c5e8ccbb3dd49dae0934c Send influence notifications to all players involved. --- diff --git a/influences/notify.py b/influences/notify.py index 1b6fb47..2e719de 100644 --- a/influences/notify.py +++ b/influences/notify.py @@ -19,7 +19,7 @@ def influence_saved(**kwargs): 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}) + notify([instance.related_players.keys(), 'lextalionis@evolution-events.nl'], 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created}) def comment_saved(**kwargs): if (settings.DEBUG): @@ -35,7 +35,7 @@ def comment_saved(**kwargs): if isinstance(object, Influence): recipients = ['lextalionis@evolution-events.nl'] if comment.is_public: - recipients.append(object.character.player) + recipients.extend(object.related_players.keys()) notify( recipients, diff --git a/templates/influences/email/influence_changed.html b/templates/influences/email/influence_changed.html index ee08310..f4c8af8 100644 --- a/templates/influences/email/influence_changed.html +++ b/templates/influences/email/influence_changed.html @@ -17,7 +17,7 @@ Subject: {% blocktrans %}Influence "{{ influence }}" was changed.{% endblocktran \\ {% filter wordwrap:72 %} {% blocktrans with influence.created|date:"j F Y" as creation_date %} -You have submitted an influence on {{ creation_date }}. +You are involved in this influence, submitted on {{ creation_date }}. {% endblocktrans %} {% if not created %} {% blocktrans %}The influence has been modified. The current status is{%endblocktrans %}:{% else %}{% blocktrans %}You submitted{% endblocktrans%}: diff --git a/templates/influences/email/influence_comment_added.html b/templates/influences/email/influence_comment_added.html index 60b62d2..656f163 100644 --- a/templates/influences/email/influence_comment_added.html +++ b/templates/influences/email/influence_comment_added.html @@ -13,7 +13,7 @@ Subject: {% blocktrans %}Comment added to influence "{{ influence }}".{% endbloc \\ {% filter wordwrap:72 %} {% blocktrans %} -{{commenter}} has just commented the following on your influence: +{{commenter}} has just commented the following on an influence you are involved in: {% endblocktrans %} \\ {{comment.comment}}