diff options
| author | J08nY | 2017-08-15 00:06:27 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-15 00:06:27 +0200 |
| commit | ba165c597fb7d7407eea609eeaff115c99645c6d (patch) | |
| tree | e3b946472661a7ff395d8485d783b1664e84a4de /src/django_pgpmailman/views/list.py | |
| parent | 9e33fdaea8eaf5825542254afb55f25c1a63fc6b (diff) | |
| download | django-pgpmailman-ba165c597fb7d7407eea609eeaff115c99645c6d.tar.gz django-pgpmailman-ba165c597fb7d7407eea609eeaff115c99645c6d.tar.zst django-pgpmailman-ba165c597fb7d7407eea609eeaff115c99645c6d.zip | |
Diffstat (limited to 'src/django_pgpmailman/views/list.py')
| -rw-r--r-- | src/django_pgpmailman/views/list.py | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/src/django_pgpmailman/views/list.py b/src/django_pgpmailman/views/list.py index dfab2f5..680a1e7 100644 --- a/src/django_pgpmailman/views/list.py +++ b/src/django_pgpmailman/views/list.py @@ -18,10 +18,15 @@ from __future__ import absolute_import, unicode_literals +from django.contrib.auth.decorators import login_required from django.core.files.base import ContentFile from django.http import HttpResponse from django.shortcuts import render +from django.utils.decorators import method_decorator +from django.views.generic import FormView +from django_pgpmailman.decorators import list_view +from django_pgpmailman.forms import ListSignatureSettingsForm from django_pgpmailman.plugin import get_pgp_plugin @@ -31,28 +36,48 @@ def pgp_list_index(request): {'lists': get_pgp_plugin().lists}) -def pgp_list_summary(request, list_id): +@list_view +def pgp_list_summary(request, pgp_list): return render(request, 'django_pgpmailman/list/summary.html', - {'pgp_list': get_pgp_plugin().get_list(list_id)}) + {'pgp_list': pgp_list}) -def pgp_list_key_management(request, list_id): +@method_decorator(login_required, name='dispatch') +@method_decorator(list_view, name='dispatch') +class ListSignatureSettingsView(FormView): + form_class = ListSignatureSettingsForm + template_name = 'django_pgpmailman/list/signature_settings.html' + + def form_valid(self, form): + pass + + +# TODO: proper list owner auth +@login_required +@list_view +def pgp_list_key_management(request, pgp_list): return render(request, 'django_pgpmailman/list/key_management.html', - {'pgp_list': get_pgp_plugin().get_list(list_id)}) + {'pgp_list': pgp_list}) -def pgp_list_encryption_settings(request, list_id): +# TODO: proper list owner auth +@login_required +@list_view +def pgp_list_encryption_settings(request, pgp_list): return render(request, 'django_pgpmailman/list/encryption_settings.html', - {'pgp_list': get_pgp_plugin().get_list(list_id)}) + {'pgp_list': pgp_list}) -def pgp_list_signature_settings(request, list_id): +# TODO: proper list owner auth +@login_required +@list_view +def pgp_list_signature_settings(request, pgp_list): return render(request, 'django_pgpmailman/list/signature_settings.html', - {'pgp_list': get_pgp_plugin().get_list(list_id)}) + {'pgp_list': pgp_list}) -def pgp_list_pubkey(request, list_id): - pgp_list = get_pgp_plugin().get_list(list_id) +@list_view +def pgp_list_pubkey(request, pgp_list): pubkey = pgp_list.pubkey pubkey_file = ContentFile(str(pubkey)) response = HttpResponse(pubkey_file, 'application/pgp-keys') |
