aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-25 21:06:32 +0100
committerAlban Gruin2017-01-25 21:06:32 +0100
commit7b738361bfac4132c3b563e0922d318d65909d38 (patch)
tree4737b962def97e9af895f27edb3f6e2ede74b829 /views.py
parentb6c273b406bcd662d6b27ca8d3deec90c873db09 (diff)
Ajout d'un mail de confirmation de désinscriptionv0.1stable/0.1.z
Diffstat (limited to 'views.py')
-rw-r--r--views.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/views.py b/views.py
index 8813187..24473d1 100644
--- a/views.py
+++ b/views.py
@@ -79,6 +79,11 @@ def confirm_subscription(request, token):
def cancel_subscription(request, token):
subscription = get_object_or_404(Subscription, token=token)
+ group = subscription.group
subscription.delete()
+ template = loader.get_template("mail/mail_unsubscribed.txt")
+ context = Context({"group": group})
+ send_mail("Confirmation de la désinscription", template.render(context), settings.DEFAULT_FROM_EMAIL, [subscription.email])
+
return redirect("index")