From 52cc134d93bea4ea8a2809ab9bf0298dccc771e4 Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Tue, 21 Apr 2020 17:05:29 +0100 Subject: added a couple of decorators missed off some view funcs --- ctrack/caf/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 251024d..5308421 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,3 +1,4 @@ +from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.shortcuts import render @@ -15,6 +16,7 @@ class ListCAF(LoginRequiredMixin, ListView): # Let's write a traditional function view! +@login_required() def caf_detail_view(request, pk): caf = CAF.objects.get(pk=pk) # get any assessments that have been done on this caf @@ -55,6 +57,7 @@ class ApplicableSystemDetail(LoginRequiredMixin, DetailView): template_name = "caf/applicablesystem_detail.html" +@login_required def applicable_system_create_from_caf(request, caf_id): org_id = CAF.objects.get(pk=caf_id).organisation().id if request.method=="POST": -- cgit v1.2.3