From 025f217a973fc91a273afc3b5b5e6a62c5fa7328 Mon Sep 17 00:00:00 2001
From: Matthew Lemon
Date: Tue, 20 Oct 2020 09:37:24 +0100
Subject: added Note form - tests passing
---
.../templates/organisations/organisation_detail.html | 2 +-
ctrack/organisations/views.py | 2 +-
ctrack/register/forms.py | 3 ++-
.../templates/register/create_note_event_form.html | 11 ++++++++---
ctrack/register/tests/test_forms.py | 5 -----
ctrack/register/views.py | 17 +++++++----------
6 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html
index 8a3d644..d981479 100644
--- a/ctrack/organisations/templates/organisations/organisation_detail.html
+++ b/ctrack/organisations/templates/organisations/organisation_detail.html
@@ -133,7 +133,7 @@
- New
+ New
note
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py
index b688fea..fa811eb 100644
--- a/ctrack/organisations/views.py
+++ b/ctrack/organisations/views.py
@@ -13,10 +13,10 @@ from ctrack.caf.models import CAF, EssentialService
from ctrack.register.models import EngagementEvent
from .forms import AddressInlineFormSet, IncidentReportForm, OrganisationCreateForm
from .models import IncidentReport, Organisation, Person
-# TODO - needs a permission on this view
from .utils import filter_private_events
+# TODO - needs a permission on this view
def essential_service_detail(request, pk):
es = EssentialService.objects.get(pk=pk)
org = es.organisation
diff --git a/ctrack/register/forms.py b/ctrack/register/forms.py
index 65c954b..8b0452f 100644
--- a/ctrack/register/forms.py
+++ b/ctrack/register/forms.py
@@ -22,8 +22,8 @@ class CreateNoteEventForm(forms.ModelForm):
class Meta:
model = NoteEvent
fields = [
- "type_descriptor",
"short_description",
+ "organisation",
"comments",
"private",
"url",
@@ -34,6 +34,7 @@ class CreateNoteEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
super().__init__(*args, **kwargs)
+ self.fields["organisation"].queryset = Organisation.objects.all().order_by('name')
def save(self, commit=True, **kwargs):
new_note = super().save(commit=False)
diff --git a/ctrack/register/templates/register/create_note_event_form.html b/ctrack/register/templates/register/create_note_event_form.html
index d6b83eb..eea336c 100644
--- a/ctrack/register/templates/register/create_note_event_form.html
+++ b/ctrack/register/templates/register/create_note_event_form.html
@@ -4,10 +4,15 @@
{% load crispy_forms_tags %}
{% block form %}
- Create a Note
+ Create a Note
Notes are associated with an organisation and are not intended to be
- formal records of events should not involve any interaction with a person
- from that organisation. Use them to record observations, notes, reminders, etc
+ formal records of events. They should not formally record any interaction with a person
+ from that organisation. Use them to record observations, notes, reminders, etc.
+
+ Mark the note as private if you wish it only to be available to you.
+
+ Formal records such as emails, phone calls and meetings can be recorded from that
+ organisations detail page.