X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/a7e41fefbf46ad5bfa2eb97dbd1cc11d3a28a354..71d31efcdb70122f705d8136239771747ca3b07d:/src/messaging/views.py?ds=inline
diff --git a/src/messaging/views.py b/src/messaging/views.py
index be83d95f2..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
@@ -13,8 +15,7 @@ def state_info(request, slug):
else:
return JsonResponse({})
- meta = state().get_objects().model._meta
-
+ meta = state().get_example_object('').model._meta
help_text = _('''Context:
{{ %(model_name)s }}
â a %(verbose_name)s object.
@@ -29,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']
+