diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-03-11 14:44:59 +0000 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-03-11 14:44:59 +0000 |
commit | 1a9ccbe3f7ec228f1fe04c20170c521ea710aefb (patch) | |
tree | df085814d255ec4f0d69e1484c660b6cc5d3976f /ctrack/caf/views.py | |
parent | e345074f25e31f644f897ae3d6a84688e29ba05c (diff) |
put in the missing LogInRequiredMixins
Diffstat (limited to 'ctrack/caf/views.py')
-rw-r--r-- | ctrack/caf/views.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index e4503e7..c2c3047 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,10 +1,11 @@ +from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import CreateView, ListView, DetailView from ctrack.caf.forms import CAFForm from ctrack.caf.models import ApplicableSystem, CAF -class CreateCAF(CreateView): +class CreateCAF(LoginRequiredMixin, CreateView): form_class = CAFForm template_name = "caf/create.html" @@ -14,15 +15,15 @@ class CreateCAF(CreateView): return context -class ListCAF(ListView): +class ListCAF(LoginRequiredMixin, ListView): pass -class DetailCAF(DetailView): +class DetailCAF(LoginRequiredMixin, DetailView): model = CAF -class ListApplicableSystem(ListView): +class ListApplicableSystem(LoginRequiredMixin, ListView): model = ApplicableSystem # apparently you can pass a list of model objects to a template if you name it # here - otherwise you need to provide a QuerySet |