15
15
from open_inwoner .openklant .api_models import KlantContactMoment
16
16
from open_inwoner .openklant .clients import build_client
17
17
from open_inwoner .openklant .constants import Status
18
- from open_inwoner .openklant .forms import ContactForm
19
18
from open_inwoner .openklant .models import ContactFormSubject
19
+ from open_inwoner .openklant .views .contactform import ContactFormView
20
20
from open_inwoner .openklant .wrap import (
21
21
fetch_klantcontactmoment ,
22
22
fetch_klantcontactmomenten ,
@@ -127,9 +127,14 @@ def get_kcm_subject(
127
127
return subject .subject
128
128
129
129
130
- class KlantContactMomentListView (PaginationMixin , KlantContactMomentBaseView ):
130
+ class KlantContactMomentListView (
131
+ PaginationMixin , ContactFormView , KlantContactMomentBaseView
132
+ ):
133
+ """
134
+ Display "contactmomenten" (questions), and a form (via ContactFormView) to send a new question
135
+ """
136
+
131
137
template_name = "pages/contactmoment/list.html"
132
- form_class = ContactForm
133
138
paginate_by = 9
134
139
135
140
@cached_property
@@ -150,7 +155,6 @@ def get_context_data(self, **kwargs):
150
155
** get_fetch_parameters (self .request , use_vestigingsnummer = True )
151
156
)
152
157
ctx ["contactmomenten" ] = [self .get_kcm_data (kcm ) for kcm in kcms ]
153
- ctx ["question_form" ] = ContactForm (user = self .request .user )
154
158
paginator_dict = self .paginate_with_context (ctx ["contactmomenten" ])
155
159
ctx .update (paginator_dict )
156
160
return ctx
0 commit comments