summaryrefslogtreecommitdiff
path: root/app/lttr/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-02-05 16:18:53 -0500
committerluxagraf <sng@luxagraf.net>2020-02-05 16:18:53 -0500
commit33209aed7c3e858d95576bdcfefa17c3f5d7597b (patch)
tree08e6877551da29c0b645208c9e9e806c4624cd42 /app/lttr/views.py
parent932a69ba325fab012630313edcfe697e93d340d7 (diff)
migrated newsletter templates and updated mailing model
Diffstat (limited to 'app/lttr/views.py')
-rw-r--r--app/lttr/views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/lttr/views.py b/app/lttr/views.py
index 0d3dbea..79b8e72 100644
--- a/app/lttr/views.py
+++ b/app/lttr/views.py
@@ -90,3 +90,14 @@ class ConfirmSubscriptionView(DetailView):
if obj.subscribed is False:
obj.update('subscribe')
return obj
+
+
+class UnsubscribeRequestView(DetailView):
+ model = Subscriber
+ template_name = "lttr/unsubscribe.html"
+
+ def get_object(self):
+ obj = Subscriber.objects.get(newsletter__slug=self.kwargs['slug'])
+ if obj.subscribed is True:
+ obj.update('unsubscribe')
+ return obj