aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/views.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py
index 1bccd3e..b929de4 100644
--- a/ctrack/organisations/views.py
+++ b/ctrack/organisations/views.py
@@ -41,11 +41,9 @@ class OrganisationCreate(LoginRequiredMixin, CreateView):
return reverse_lazy("organisations:detail", kwargs={"slug": self.object.slug})
-class OrganisationListView(LoginRequiredMixin, UserPassesTestMixin, ListView):
+class OrganisationListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
model = Organisation
-
- def test_func(self):
- return self.request.user.is_staff
+ permission_required = "organisations.view_organisation"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)