diff options
author | luxagraf <sng@luxagraf> | 2021-03-21 20:51:36 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf> | 2021-03-21 20:51:36 -0400 |
commit | 13ed0a5e81c0da5ab639a017a7d03e2bafdddeea (patch) | |
tree | a4d9986408b0b747560b87003462e5221ac00aac /app/lttr/views.py | |
parent | 44af81a8b1875321fb4c97c471290d6a888c1e46 (diff) |
src: made signup form work
Diffstat (limited to 'app/lttr/views.py')
-rw-r--r-- | app/lttr/views.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/lttr/views.py b/app/lttr/views.py index 9682528..f5cd28a 100644 --- a/app/lttr/views.py +++ b/app/lttr/views.py @@ -83,14 +83,19 @@ class NewsletterSubscribeView(CreateView): model = Subscriber form_class = SubscribeRequestForm action = 'subscribe' + slug = None def get_template_names(self): - return ["lttr/%s_subscribe.html" % self.kwargs['slug'], 'lttr/subscribe.html'] + return ["lttr/%s_subscribe.html" % self.slug, 'lttr/subscribe.html'] def get_form_kwargs(self): kwargs = super(NewsletterSubscribeView, self).get_form_kwargs() - nl = Newsletter.objects.get(slug=self.kwargs['slug']) + try: + self.slug = self.kwargs['slug'] + except: + pass + nl = Newsletter.objects.get(slug=self.slug) kwargs['newsletter'] = nl return kwargs |