X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c45e85759d12da179c7e42281588fc6affd99aa0..71d31efcdb70122f705d8136239771747ca3b07d:/src/messaging/views.py diff --git a/src/messaging/views.py b/src/messaging/views.py index 31debe180..f3881bb61 100644 --- a/src/messaging/views.py +++ b/src/messaging/views.py @@ -3,6 +3,8 @@ from django.http import JsonResponse from django.urls import reverse from django.shortcuts import render from django.utils.translation import ugettext as _ +from django.views.generic import UpdateView +from . import models from .states import states @@ -28,3 +30,10 @@ def state_info(request, slug): "help": help_text, }) + +class OptOutView(UpdateView): + model = models.Contact + slug_url_kwarg = 'key' + slug_field = 'key' + fields = ['level'] +