From 0b21af98cc1628f7a2dfcd9a1142c2fda0ae79ff Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 20 Oct 2020 08:29:51 +0200 Subject: [PATCH] additional preliminary work for authorize/deny links in IF mail --- input/templates/input/if_mail.txt | 4 ++-- input/urls.py | 4 ++-- input/views.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/input/templates/input/if_mail.txt b/input/templates/input/if_mail.txt index bf11055..ce2d7a4 100644 --- a/input/templates/input/if_mail.txt +++ b/input/templates/input/if_mail.txt @@ -13,8 +13,8 @@ Der Nutzer mit dem Username {{data.username}} fragt ein {% if data.choice == 'LI {% elif data.choice == 'VIS' %} Visitenkarten, Mailingliste oder E-Mail-Adresse {% else %} ERROR UNKNOWN FORMTYPE {% endif %} an. -Genehmigen: http://127.0.0.1:8000/authorize/{{data.id}} -Ablehnen: http://127.0.0.1:8000/deny/{{data.id}} +Genehmigen: http://127.0.0.1:8000/authorize/{{data.choice}}/{{data.pk}} +Ablehnen: http://127.0.0.1:8000/deny/{{data.choice}}/{{data.pk}} {% comment %} diff --git a/input/urls.py b/input/urls.py index c8e0d26..263d809 100644 --- a/input/urls.py +++ b/input/urls.py @@ -9,6 +9,6 @@ urlpatterns = [ path('certificate', certificate, name='certificate'), path('extern', ExternView.as_view(), name='extern'), path('saved', done, name='done'), - path('authorize/', authorize, name='authorize'), - path('deny/', deny, name='deny') + path('authorize//', authorize, name='authorize'), + path('deny//', deny, name='deny') ] diff --git a/input/views.py b/input/views.py index 9e12182..3942412 100644 --- a/input/views.py +++ b/input/views.py @@ -107,7 +107,7 @@ class ExternView(CookieWizardView): form.save() # add primary key to context - data['id'] = 100 + data['pk'] = form.pk # we need to send the following mails here: context = { 'data': data }