From: Matthijs Kooijman Date: Fri, 1 Feb 2008 09:25:07 +0000 (+0100) Subject: * Also notify the influence submitter that his influence was modified. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=4290e24abab936a454d2590e69320a6d0c93d6bc;p=matthijs%2Fprojects%2Fxerxes.git * Also notify the influence submitter that his influence was modified. --- diff --git a/influences/notify.py b/influences/notify.py index 3cbb94e..2bf7483 100644 --- a/influences/notify.py +++ b/influences/notify.py @@ -8,3 +8,9 @@ def character_saved(instance, created): notify(instance.player, 'influences/email/character_changed', {'character' : instance, 'created' : created}) dispatcher.connect(character_saved, signals.post_save, Character) + +def influence_saved(instance, created): + # TODO: Perhaps only notify when the status is / becomes Done? + notify(instance.character.player, 'influences/email/influence_changed', {'influence' : instance, 'created' : created}) + +dispatcher.connect(influence_saved, signals.post_save, Influence) diff --git a/templates/influences/email/influence_changed b/templates/influences/email/influence_changed new file mode 100644 index 0000000..e9b72bf --- /dev/null +++ b/templates/influences/email/influence_changed @@ -0,0 +1,21 @@ +{% autoescape off %}From: Inschrijfsysteem +Subject: Influence {{ influence }} was changed. + +{% filter lower|wordwrap:72 %} +You have submitted an influence on {{influence.created}}. +{% if not created %}The influence has been modified. The current status is:{% else %}You submitted:{% endif %} +{% endfilter %} +Character: {{ influence.character }} +Contact: {{ influence.contact }} +Summary: {{ influence.summary }} +Status: {{ influence.get_status_display }} +Long term: {{ influence.longterm }} + +Description: +{{ influence.description }} + +{% if influence.result %} +Result: +{{ influence.result }} +{% endif %} +{% endautoescape %}