diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-31 20:09:27 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-31 21:18:28 +0100 |
commit | fab21cad7fa2e85633e993c87cc11db52eae4f13 (patch) | |
tree | fc390a6875060bac31d838e1d09f941cba789cb0 /ctrack/organisations/views.py | |
parent | 41f81ff7952630d68eeadde458b480740030e557 (diff) |
working on test for cct_user to view person list
Diffstat (limited to 'ctrack/organisations/views.py')
-rw-r--r-- | ctrack/organisations/views.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index 30ce5a0..d918c71 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -1,17 +1,19 @@ from typing import Any, Dict -from django.contrib.auth.mixins import ( - LoginRequiredMixin, - PermissionRequiredMixin, - UserPassesTestMixin, -) +from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.db import transaction from django.http import HttpResponseRedirect from django.urls import reverse, reverse_lazy from django.views.generic import CreateView, DetailView, FormView, ListView from .forms import AddressInlineFormSet, IncidentReportForm, OrganisationCreateForm -from .models import IncidentReport, Organisation +from .models import IncidentReport, Organisation, Person + + +class PersonListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): + model = Person + template_name = "organisations/person_list.html" + permission_required = "organisations.view_person" class OrganisationCreate(LoginRequiredMixin, CreateView): |