diff options
author | luxagraf <sng@luxagraf.net> | 2020-11-11 14:54:09 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-11-11 14:54:09 -0500 |
commit | 52c80b30dc84d85cbad2fe317d1058e6a0c58803 (patch) | |
tree | 1b9a56cd06879763bbe9f724d46a46ff54b28c8b /app/lttr/views.py | |
parent | 1cfbf44615d5053e6e200972ff74ade38e7d7c31 (diff) |
finished up newsletter formatting and delivery. Just need to clean up
the rough edges
Diffstat (limited to 'app/lttr/views.py')
-rw-r--r-- | app/lttr/views.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/lttr/views.py b/app/lttr/views.py index e12d5a7..bf3df4c 100644 --- a/app/lttr/views.py +++ b/app/lttr/views.py @@ -93,7 +93,14 @@ class UnsubscribeRequestView(DetailView): template_name = "lttr/unsubscribe.html" def get_object(self): - obj = Subscriber.objects.get(newsletter__slug=self.kwargs['slug']) + obj = Subscriber.objects.get(newsletter__slug=self.kwargs['slug'],activation_code=self.kwargs['activation_code']) if obj.subscribed is True: obj.update('unsubscribe') return obj + + + def get_context_data(self, **kwargs): + context = super(UnsubscribeRequestView, self).get_context_data(**kwargs) + context['subscriber'] = self.get_object() + context['newsletter'] = self.kwargs['slug'] + return context |