From 1e066952e9677aa5119f845deb509b0e16c325f1 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Fri, 2 Sep 2016 09:31:12 +1000 Subject: [PATCH] Reports now need staff credentials to load. --- registrasion/staff_views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/registrasion/staff_views.py b/registrasion/staff_views.py index 17b30b5f..77226ab0 100644 --- a/registrasion/staff_views.py +++ b/registrasion/staff_views.py @@ -1,9 +1,12 @@ import forms +import views +from django.contrib.auth.decorators import user_passes_test from django.db import models from django.db.models import F, Q from django.db.models import Sum from django.db.models import Case, When, Value +from django.http import Http404 from django.shortcuts import render from functools import wraps @@ -63,6 +66,7 @@ def report(title, form_type): def _report(view): @wraps(view) + @user_passes_test(views._staff_only) def inner_view(request, *a, **k): form = form_type(request.GET)