aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/views.py
diff options
context:
space:
mode:
authorMR Lemon <matt@matthewlemon>2020-04-20 16:39:16 +0100
committerMR Lemon <matt@matthewlemon>2020-04-20 16:39:16 +0100
commit6c06361481ae9565b3da523b360c480ead48c47e (patch)
treeaccea8eac4fbad4ba37b26e776ccd48c2baa33bb /ctrack/caf/views.py
parent324f91f31141fd35ad108142922956893dc4fd3e (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.py10
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"])