From 943130fddd819f09ebcb7c7ca3f25fef7fbccb21 Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Wed, 13 Apr 2022 19:35:21 +0200 Subject: [PATCH] add missing login_required mixins to team views --- shiftregister/team/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shiftregister/team/views.py b/shiftregister/team/views.py index 37253f9..c0239f2 100644 --- a/shiftregister/team/views.py +++ b/shiftregister/team/views.py @@ -5,6 +5,7 @@ from django.db.models.fields import DateTimeField from django.db.models import F, Count, Q, ExpressionWrapper from .models import ShiftRegistration, Room, Shift, Helper from django.views.generic import DetailView, ListView +from django.contrib.auth.mixins import LoginRequiredMixin # Create your views here. def index(request): @@ -20,14 +21,14 @@ def shift_overview(request): return render(request, 'shift_overview.html', context) -class ShiftDetail(DetailView): +class ShiftDetail(LoginRequiredMixin, DetailView): template_name = "shift_detail.html" model= Shift -class HelperDetail(DetailView): +class HelperDetail(LoginRequiredMixin, DetailView): template_name = "helper_detail.html" model= Helper -class ShiftList(ListView): +class ShiftList(LoginRequiredMixin, ListView): template_name = "shift_list.html" model= Shift \ No newline at end of file