Reports now need staff credentials to load.

This commit is contained in:
Christopher Neugebauer 2016-09-02 09:31:12 +10:00
parent 66226663d5
commit 1e066952e9

View file

@ -1,9 +1,12 @@
import forms import forms
import views
from django.contrib.auth.decorators import user_passes_test
from django.db import models from django.db import models
from django.db.models import F, Q from django.db.models import F, Q
from django.db.models import Sum from django.db.models import Sum
from django.db.models import Case, When, Value from django.db.models import Case, When, Value
from django.http import Http404
from django.shortcuts import render from django.shortcuts import render
from functools import wraps from functools import wraps
@ -63,6 +66,7 @@ def report(title, form_type):
def _report(view): def _report(view):
@wraps(view) @wraps(view)
@user_passes_test(views._staff_only)
def inner_view(request, *a, **k): def inner_view(request, *a, **k):
form = form_type(request.GET) form = form_type(request.GET)