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