diff options
author | MR Lemon <matt@matthewlemon> | 2020-04-20 16:39:16 +0100 |
---|---|---|
committer | MR Lemon <matt@matthewlemon> | 2020-04-20 16:39:16 +0100 |
commit | 6c06361481ae9565b3da523b360c480ead48c47e (patch) | |
tree | accea8eac4fbad4ba37b26e776ccd48c2baa33bb /ctrack/caf/views.py | |
parent | 324f91f31141fd35ad108142922956893dc4fd3e (diff) |
Completed a manual forms.Form to create a new ApplicableSystem - REFERENCE CODE
Diffstat (limited to 'ctrack/caf/views.py')
-rw-r--r-- | ctrack/caf/views.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 2bfe7ad..003cb18 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -63,6 +63,16 @@ class ApplicableSystemCreateFromOrg(LoginRequiredMixin, FormView): context["organisation"] = Organisation.objects.get(slug=self.kwargs["slug"]) return context + def form_valid(self, form): + ass = ApplicableSystem.objects.create( + name=form.cleaned_data["name"], + description=form.cleaned_data["description"], + organisation=form.cleaned_data["organisation"], + caf=form.cleaned_data["caf"] + ) + return super().form_valid(form) + + def get_form_kwargs(self): kwargs = super().get_form_kwargs() org = Organisation.objects.get(slug=self.kwargs["slug"]) |