From 4290e24abab936a454d2590e69320a6d0c93d6bc Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 1 Feb 2008 10:25:07 +0100 Subject: [PATCH] * Also notify the influence submitter that his influence was modified. --- influences/notify.py | 6 ++++++ templates/influences/email/influence_changed | 21 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 templates/influences/email/influence_changed 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 %} -- 2.30.2