From d52461205df0ad96a04ebcd60cc9239af89556b3 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 28 Apr 2022 16:03:54 +0200 Subject: [PATCH] Fix invalid redirect on unauthorized access to team app --- shiftregister/team/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shiftregister/team/views.py b/shiftregister/team/views.py index 085019c..c218969 100644 --- a/shiftregister/team/views.py +++ b/shiftregister/team/views.py @@ -14,7 +14,7 @@ def index(request): pass -@login_required +@login_required(login_url="/admin/login/") def shift_overview(request): context = {} context["running_shifts"] = [ @@ -44,7 +44,7 @@ def add_helper_shift(self): pass -@login_required() +@login_required(login_url="/admin/login/") def shift_detail(request, pk): shift = get_object_or_404(Shift, pk=pk) form = HelperShift() @@ -75,11 +75,13 @@ def shift_detail(request, pk): class HelperDetail(LoginRequiredMixin, DetailView): + login_url = "/admin/login/" template_name = "helper_detail.html" model = Helper class ShiftList(LoginRequiredMixin, ListView): + login_url = "/admin/login/" template_name = "shift_list.html" model = Shift title = "Alle Schichten"