diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/forms.py | 8 | ||||
-rw-r--r-- | ctrack/caf/urls.py | 3 | ||||
-rw-r--r-- | ctrack/caf/views.py | 9 |
3 files changed, 2 insertions, 18 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py index c2d75ff..28a85d2 100644 --- a/ctrack/caf/forms.py +++ b/ctrack/caf/forms.py @@ -4,17 +4,11 @@ from crispy_forms.layout import ButtonHolder from crispy_forms.layout import Fieldset from crispy_forms.layout import Layout from crispy_forms.layout import Submit - from django import forms - -from django.urls import reverse - from django.forms import inlineformset_factory +from ctrack.caf.models import ApplicableSystem from ctrack.caf.models import CAF -from ctrack.caf.models import ApplicableSystem, DocumentFile -from ctrack.organisations.models import Organisation -from django.forms.models import ModelMultipleChoiceField CAFCreateInlineFormset = inlineformset_factory( CAF, ApplicableSystem, fields=("name", "organisation"), extra=2) diff --git a/ctrack/caf/urls.py b/ctrack/caf/urls.py index ff1243f..5b64be4 100644 --- a/ctrack/caf/urls.py +++ b/ctrack/caf/urls.py @@ -2,7 +2,7 @@ from django.urls import path from django.views.decorators.cache import cache_page from ctrack.caf.views import ListCAF, ListApplicableSystem, caf_detail_view, ApplicableSystemDetail, \ - ApplicableSystemCreate, ApplicableSystemCreateFromOrg + ApplicableSystemCreateFromOrg app_name = "caf" @@ -11,6 +11,5 @@ urlpatterns = [ path("applicablesystems", cache_page(60 * 60)(ListApplicableSystem.as_view()), name="es_list"), path("applicablesystems/<int:pk>", ApplicableSystemDetail.as_view(), name="ass_detail"), path("applicablesystem/<slug:slug>", ApplicableSystemCreateFromOrg.as_view(), name="create_from_org"), - path("applicablesystem/", ApplicableSystemCreate.as_view(), name="create"), path("<int:pk>", caf_detail_view, name="detail") ] diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 07fd1b1..5dcf7ee 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -71,12 +71,3 @@ class ApplicableSystemCreateFromOrg(LoginRequiredMixin, CreateView): def get_success_url(self): return reverse_lazy("organisations:detail", args=[self.kwargs['slug']]) - - -class ApplicableSystemCreate(LoginRequiredMixin, CreateView): - form_class = ApplicableSystemCreateForm - model = ApplicableSystem - template_name = "caf/applicablesystem_create.html" - - def get_success_url(self) -> str: - return str(reverse_lazy("caf:ass_detail", args=[self.object.id])) |