aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/views.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/register/views.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/ctrack/register/views.py b/ctrack/register/views.py
index f8da4f1..935bbed 100644
--- a/ctrack/register/views.py
+++ b/ctrack/register/views.py
@@ -7,7 +7,7 @@ from ctrack.caf.models import CAF
from ctrack.organisations.models import Organisation
from ctrack.register.forms import (
CreateSimpleDateTimeEventForm,
- EngagementEventCreateForm,
+ EngagementEventCreateForm, CreateNoteEventForm,
)
from ctrack.register.models import EngagementEvent, SingleDateTimeEvent, NoteEvent
@@ -75,18 +75,15 @@ class EngagementEventCreateFromCaf(FormView):
class CreateNoteEvent(CreateView):
+ form_class = CreateNoteEventForm
model = NoteEvent
- fields = [
- "short_description",
- "organisation",
- "comments",
- "private",
- "url",
- "requested_response_date",
- "response_received_date",
- ]
template_name = "register/create_note_event_form.html"
+ def get_form_kwargs(self):
+ kwargs = super().get_form_kwargs()
+ kwargs["user"] = self.request.user
+ return kwargs
+
def form_valid(self, form):
note = form.save(commit=False)
note.user = self.request.user