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 --- ctrack/register/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ctrack/register/forms.py') 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) -- cgit v1.2.3